[old] Unattended Guest OS Install - vbox-unattended
Posted: 19. Dec 2011, 15:38
(a.k.a. coffee break system installation)
This is the implementation. For Research Paper, see this:
viewtopic.php?f=10&t=46816&p=211275#p211275
Install instructions: (Debian Linux)
1. New Dependencies:
# apt-get install p7zip-full mtools genisoimage
2. Download & install patched VirtualBox-unattended-OSE for Linux: (4.1.29)
http://www.qumble.org/Downloads/Virtual ... r89849.run
2.a. [OPTIONAL] MD5SUM:
2e22e1568a49c0585ab7d4dee6eec50e /home/alexey/1/VirtualBox-4.1.29_unattended-OSE-r89849.run
3. Make sure you use Oracle's guest additions:
Download http://download.virtualbox.org/virtualb ... 4.1.28.iso
cp [path]/VBoxGuestAdditions_4.1.28.iso /opt/VirtualBox/additions/VBoxGuestAdditions.iso
Good news !
I have finally achieved first milestone - first working version !
This project lets you to install any supported guest OS in 10 minutes !
Supported Guest OSes:
------------------------------------
1. Windows NT 5 (tested with Windows XP, 32bit)
2. Windows NT 6 (tested with Windows Vista, 32bit)
3. Red Hat kickstart (tested with RHEL 3/4/5, 32+64bit)
4. Debian preseed (tested with Debian 6.0 DVD, both 32+64bit)
5. SUSE autoyast (tested with openSUSE 11.3/11.4, 32+64bit)
------------------------------------
Following the topics:
viewtopic.php?f=9&t=26005
and
viewtopic.php?f=9&t=42926
I decided to write a small program, that does exactly this work:
named 'vbox-unattended'
Why I write 'vbox-unattended' ?
Because:
Installing Windows XP by coffee-drinking people takes about 30 min
Installing Windows XP by active geek, clicking instantly takes about 15 min
Installing Windows XP by Unattended Install, takes about 10 min, letting people to drink coffee in first place.
(on standard Core2-class hardware with HDD)
Also because:
*no reason to let VMware to steal whole market (but that's secondary reason)
-----------------------------------------------------------
Design Goals:
-----------------------------------------------------------
The system should:
1. run on any host OS supported by VirtualBox, (I try to avoid host-OS-specific tricks, if possible, but for now only Linux + FBSD host is implemented)
2. be simple to implement,
3. be offline (i.e. not require an Internet connection),
4. be fast (i.e. generate only minimal remastered boot CD image, rather than whole OS CD image)
5. support both Windows guests and several major Linux guest families (Debian, Red Hat, SUSE).
6. be Free Software (dependency on non-free software is forbidden, support is 'OK')
Target: Desktop users. (but also useful for: sysadmins, VBox QA, distro-hoppers, newbies)
-----------------------------------------------------------
vbox-unattended was written on Debian GNU/Linux 6.0 and tested with VirtualBox 4.1.
It currently supports only Linux-hosts with Windows guests (NT 5x and NT 6x families: Windows 2000/XP/2003/Vista/7/2008 guests, tested with WinXP/Vista, 32-bit), Red-Hat-like Linux guests. (Tested with RHEL3/4/5 32-bit)), Debian guests (tested with Debian 6), and SUSE guests (tested with openSUSE 11.3/11.4, 32-bit).
Due to it's beta quality the software may not function properly as advertised.
Because the basic design is OS-neutral, porting it from Linux to Windows hosts should be possible later...
TODO:
-more tests and stability
-pushing upstream
How to use: (python version)
Python version works like a 3rd party application, with standard VirtualBox v4.1.x.
1. edit vboxunattended.py - last 10 lines - this will configure your stuff.
2. run it:
$ python ./vboxunattended.py
Release Notes:
1. It works !
2. Full VirtualBox GUI and Main API integration ! (for C++ version)
3. To install Debian 6 guest, you need the first DVD, 1 of 8. (32-bit or 64-bit Squeeze)
4. Linux / FreeBSD hosts only
5. working from physical CD-ROM is not supported. (only with ISO images)
6. for each run, you must change VM name inside "vboxunattended.py" - in last 10 lines. (python version only)
7. RHEL6 and Fedora guest OS support are broken.
8. there is no cleanup code, so you can study the leftovers... (@_@)
Changelog:
-v0.1 - 2011-12-19: First release. supports Linux hosts and Windows NT 5.x and NT 6.x guests (python only)
-v0.2 - 2011-12-20: added support for Red-Hat-like Linux guests (via Red Hat Anaconda kickstart backend)
-v0.3 - 2011-12-24: added support for VirtualBox Guest Additions + improved stability.
-v0.4 - 2011-12-29: added support for Debian Linux guests (via Debian preseed backend)
-v0.5 - 2011-12-31: added support for SUSE Linux guests (via AutoYast backend) + improved code arch.
HAPPY NEW YEAR 2012 !
v0.5.1-2012-01-01: hugely improved support for Debian guests.
v0.6.0-2012-01-10: Complete rewrite in C++ ! Features VirtualBox GUI integration !
v0.6.1-2012-01-12: First BETA ! Basic functionality is mostly stable. C++ and python combined release !
v0.6.2-2012-01-17: Fixed bug with folders with spaces (hosts) and workaround for Debian Bug #655841. (Debian guests)
v0.6.3-2012-01-17: added support for FreeBSD hosts and small fix for Debian guests. (thanks to "nox-")
v0.7 - 2012-02-01: Near complete rewrite in COM C++, integrated into VBox Main API.
v0.7.1 - 2013-10-18: Refactored patch to apply on top of VirtualBox OSE 4.1.28. + First binary build that you can download and run !
v0.6.1. details:
1. Combined release in C++ and python. (they have similar function names,
and similar features). GUI is provided with the C++ version.
2. Critical bug fixed: libunattended.cpp in file read code. (C++ only)
3. Red Hat guest support went throught a major rewrite:
- added support for Red Hat Enterprise Linux guests (C++ version)
- added "password encrypter" (this solves the problem, that
Red Hat requires encrypted passwords by crypt(3) POSIX function.
- added better granularity to IGuestOSType (C++ only)
The bad news: Introduction of RHEL guests forced me to make incompatible changes in VirtualBox.
The v0.6.1 C++ version is not 100% compatible with the original.
4. As per <Teknomancer>'s recommendation, I replaced system("mkdir")
with "IPRT RTDirCreate()" (C++ only)
5. Debian 6.0 guest found to be non-deterministic, swapping
between /dev/cdrom and /dev/cdrom1 at random.
Problem hopefully solved by using /dev/sr0, which seems reliable.
6. python code got much better abstraction, and much code removed.
v0.7:
vbox-unattended has now integrated much deeper into the core of VirtualBox.
+Introduces New Main API: IMachine::IUnattended
+customizable Unattended pipeline. You can hook into the Unattended pipeline and change things on the fly.
+3rd near complete rewrite. (1st was in python, 2nd in Qt C++)
+GUI: First Run Wizard is now disabled for unattended machines.
+Visually and functionally it is a carbon copy of v0.6.3.
License: MIT/X11.
====
-Technologov
This is the implementation. For Research Paper, see this:
viewtopic.php?f=10&t=46816&p=211275#p211275
Install instructions: (Debian Linux)
1. New Dependencies:
# apt-get install p7zip-full mtools genisoimage
2. Download & install patched VirtualBox-unattended-OSE for Linux: (4.1.29)
http://www.qumble.org/Downloads/Virtual ... r89849.run
2.a. [OPTIONAL] MD5SUM:
2e22e1568a49c0585ab7d4dee6eec50e /home/alexey/1/VirtualBox-4.1.29_unattended-OSE-r89849.run
3. Make sure you use Oracle's guest additions:
Download http://download.virtualbox.org/virtualb ... 4.1.28.iso
cp [path]/VBoxGuestAdditions_4.1.28.iso /opt/VirtualBox/additions/VBoxGuestAdditions.iso
Good news !
I have finally achieved first milestone - first working version !
This project lets you to install any supported guest OS in 10 minutes !
Supported Guest OSes:
------------------------------------
1. Windows NT 5 (tested with Windows XP, 32bit)
2. Windows NT 6 (tested with Windows Vista, 32bit)
3. Red Hat kickstart (tested with RHEL 3/4/5, 32+64bit)
4. Debian preseed (tested with Debian 6.0 DVD, both 32+64bit)
5. SUSE autoyast (tested with openSUSE 11.3/11.4, 32+64bit)
------------------------------------
Following the topics:
viewtopic.php?f=9&t=26005
and
viewtopic.php?f=9&t=42926
I decided to write a small program, that does exactly this work:
named 'vbox-unattended'
Why I write 'vbox-unattended' ?
Because:
Installing Windows XP by coffee-drinking people takes about 30 min
Installing Windows XP by active geek, clicking instantly takes about 15 min
Installing Windows XP by Unattended Install, takes about 10 min, letting people to drink coffee in first place.
(on standard Core2-class hardware with HDD)
Also because:
*no reason to let VMware to steal whole market (but that's secondary reason)
-----------------------------------------------------------
Design Goals:
-----------------------------------------------------------
The system should:
1. run on any host OS supported by VirtualBox, (I try to avoid host-OS-specific tricks, if possible, but for now only Linux + FBSD host is implemented)
2. be simple to implement,
3. be offline (i.e. not require an Internet connection),
4. be fast (i.e. generate only minimal remastered boot CD image, rather than whole OS CD image)
5. support both Windows guests and several major Linux guest families (Debian, Red Hat, SUSE).
6. be Free Software (dependency on non-free software is forbidden, support is 'OK')
Target: Desktop users. (but also useful for: sysadmins, VBox QA, distro-hoppers, newbies)
-----------------------------------------------------------
vbox-unattended was written on Debian GNU/Linux 6.0 and tested with VirtualBox 4.1.
It currently supports only Linux-hosts with Windows guests (NT 5x and NT 6x families: Windows 2000/XP/2003/Vista/7/2008 guests, tested with WinXP/Vista, 32-bit), Red-Hat-like Linux guests. (Tested with RHEL3/4/5 32-bit)), Debian guests (tested with Debian 6), and SUSE guests (tested with openSUSE 11.3/11.4, 32-bit).
Due to it's beta quality the software may not function properly as advertised.
Because the basic design is OS-neutral, porting it from Linux to Windows hosts should be possible later...
TODO:
-more tests and stability
-pushing upstream
How to use: (python version)
Python version works like a 3rd party application, with standard VirtualBox v4.1.x.
1. edit vboxunattended.py - last 10 lines - this will configure your stuff.
2. run it:
$ python ./vboxunattended.py
Release Notes:
1. It works !
2. Full VirtualBox GUI and Main API integration ! (for C++ version)
3. To install Debian 6 guest, you need the first DVD, 1 of 8. (32-bit or 64-bit Squeeze)
4. Linux / FreeBSD hosts only
5. working from physical CD-ROM is not supported. (only with ISO images)
6. for each run, you must change VM name inside "vboxunattended.py" - in last 10 lines. (python version only)
7. RHEL6 and Fedora guest OS support are broken.
8. there is no cleanup code, so you can study the leftovers... (@_@)
Changelog:
-v0.1 - 2011-12-19: First release. supports Linux hosts and Windows NT 5.x and NT 6.x guests (python only)
-v0.2 - 2011-12-20: added support for Red-Hat-like Linux guests (via Red Hat Anaconda kickstart backend)
-v0.3 - 2011-12-24: added support for VirtualBox Guest Additions + improved stability.
-v0.4 - 2011-12-29: added support for Debian Linux guests (via Debian preseed backend)
-v0.5 - 2011-12-31: added support for SUSE Linux guests (via AutoYast backend) + improved code arch.
HAPPY NEW YEAR 2012 !
v0.5.1-2012-01-01: hugely improved support for Debian guests.
v0.6.0-2012-01-10: Complete rewrite in C++ ! Features VirtualBox GUI integration !
v0.6.1-2012-01-12: First BETA ! Basic functionality is mostly stable. C++ and python combined release !
v0.6.2-2012-01-17: Fixed bug with folders with spaces (hosts) and workaround for Debian Bug #655841. (Debian guests)
v0.6.3-2012-01-17: added support for FreeBSD hosts and small fix for Debian guests. (thanks to "nox-")
v0.7 - 2012-02-01: Near complete rewrite in COM C++, integrated into VBox Main API.
v0.7.1 - 2013-10-18: Refactored patch to apply on top of VirtualBox OSE 4.1.28. + First binary build that you can download and run !
v0.6.1. details:
1. Combined release in C++ and python. (they have similar function names,
and similar features). GUI is provided with the C++ version.
2. Critical bug fixed: libunattended.cpp in file read code. (C++ only)
3. Red Hat guest support went throught a major rewrite:
- added support for Red Hat Enterprise Linux guests (C++ version)
- added "password encrypter" (this solves the problem, that
Red Hat requires encrypted passwords by crypt(3) POSIX function.
- added better granularity to IGuestOSType (C++ only)
The bad news: Introduction of RHEL guests forced me to make incompatible changes in VirtualBox.
The v0.6.1 C++ version is not 100% compatible with the original.
4. As per <Teknomancer>'s recommendation, I replaced system("mkdir")
with "IPRT RTDirCreate()" (C++ only)
5. Debian 6.0 guest found to be non-deterministic, swapping
between /dev/cdrom and /dev/cdrom1 at random.
Problem hopefully solved by using /dev/sr0, which seems reliable.
6. python code got much better abstraction, and much code removed.
v0.7:
vbox-unattended has now integrated much deeper into the core of VirtualBox.
+Introduces New Main API: IMachine::IUnattended
+customizable Unattended pipeline. You can hook into the Unattended pipeline and change things on the fly.
+3rd near complete rewrite. (1st was in python, 2nd in Qt C++)
+GUI: First Run Wizard is now disabled for unattended machines.
+Visually and functionally it is a carbon copy of v0.6.3.
License: MIT/X11.
====
-Technologov