VirtualBox/Preparing a disk image
Jump to navigation
Jump to search
Instructions for preparing a VirtualBox disk image from a SoaS iso image file.
- (Taken from Dave Bauer's posting at http://schools.sugarlabs.org/mod/forum/discuss.php?d=27.)
- Updated 21 May 2010 with VirtualBox 3.2.0 and 64-bit Fedora.
Installing SoaS iso image
- Create a new VM, choose a name such a Mirabelle
- Choose Linux for the Operating System and Version Fedora (64 bit)
- Choose Base Memory Size: 256 MB to match an XO-1, 512 or 1024 MB to match an XO-1.5
- Create a new virtual hard disk image with dynamically expanding storage of 2 GB
- Finish.
- Download the lastest SoaS, http://alt.fedoraproject.org/pub/alt/nightly-composes/soas/, for Fedora 13.
- Mount the SoaS .iso image file as a CD-ROM in the newly created VM.
- Change the Network Attached to: Bridged Adapter (This allows for networking with the host computer.)
- Start the VM
- Type you name and startup Sugar.
- Open Terminal.
- su -
- parted /dev/sda
- mklabel msdos -- make partition table
- mkpartfs primary ext2 0 2048
- toggle 1 boot
- quit
- umount /dev/sda1 -- (not required with soas-2-blueberry.iso)
- /media/soas-2-blueberry/LiveOS/livecd-iso-to-disk --overlay-size-mb 400 /dev/sr0 /dev/sda1
- (for earlier versions of SoaS, like Strawberry, use /mnt/live/LiveOS/livecd-iso-to-disk ...
soas05.iso carries an incompatible version of livecd-iso-to-disk, see this bug report.)
- the --overlay-size-mb NNN option creates space for persistence of changes on the disk; otherwise, a liveOS disk is read-only.
The following optional parameters seem to be incompatible with soas-1-strawberry and soas-2-blueberry released versions. (The script completes successfully, but the virtual machine startup process has trouble finding the home directory and fails to complete.)
- the --home-size-mb NNN option creates space for saving the /home/liveuser folder if you want to update the OS image while keeping the user files. (In this case, skip the new disk creation and parted steps and leave out the --home-size-mb NNN option at this step and continue on.)
- the --unencrypted-home option prevents password protection and encryption on the /home/liveuser folder. This releaves the overhead on the compressed squashfs and should be more robust to file system failures (outside of security).
- the --delete-home option is used to avoid an error message while requesting both a new home (with --home-size-mb) and a persistent home (with--unencrypted-home). You wouldn't use this option on an upgrade.
- (for earlier versions of SoaS, like Strawberry, use /mnt/live/LiveOS/livecd-iso-to-disk ...
- shutdown -h now
Installing VirtualBox Guest Additions
- Unmount CDROM in VirtualBox settings
- Mount VBoxGuestAdditions.iso in its place.
- Boot VM
- Open Terminal
- su -
- yum install dkms gcc make
- (Other dependencies will be called into the installation.)
<yum.log from 06 December 2009:>
[root@localhost ~]# yum install dkms gcc make Loaded plugins: presto, refresh-packagekit fedora/metalink | 18 kB 00:00 fedora | 4.2 kB 00:00 fedora/primary_db | 9.7 MB 01:50 sugar | 1.3 kB 00:00 sugar/primary | 5.9 kB 00:00 sugar 25/25 updates/metalink | 17 kB 00:00 updates | 4.4 kB 00:00 updates/primary_db | 1.3 MB 00:14 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package dkms.noarch 0:2.1.0.1-1.fc12 set to be updated --> Processing Dependency: kernel-devel for package: dkms-2.1.0.1-1.fc12.noarch ---> Package gcc.i686 0:4.4.2-7.fc12 set to be updated --> Processing Dependency: cpp = 4.4.2-7.fc12 for package: gcc-4.4.2-7.fc12.i686 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.2-7.fc12.i686 --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.2-7.fc12.i686 ---> Package make.i686 1:3.81-18.fc12 set to be updated --> Running transaction check ---> Package cloog-ppl.i686 0:0.15.7-1.fc12 set to be updated --> Processing Dependency: libppl_c.so.2 for package: cloog-ppl-0.15.7-1.fc12.i686 --> Processing Dependency: libgmpxx.so.4 for package: cloog-ppl-0.15.7-1.fc12.i686 --> Processing Dependency: libppl.so.7 for package: cloog-ppl-0.15.7-1.fc12.i686 --> Processing Dependency: libgmp.so.3 for package: cloog-ppl-0.15.7-1.fc12.i686 ---> Package cpp.i686 0:4.4.2-7.fc12 set to be updated --> Processing Dependency: libmpfr.so.1 for package: cpp-4.4.2-7.fc12.i686 ---> Package glibc-devel.i686 0:2.11-2 set to be updated --> Processing Dependency: glibc-headers = 2.11-2 for package: glibc-devel-2.11-2.i686 --> Processing Dependency: glibc-headers for package: glibc-devel-2.11-2.i686 ---> Package kernel-devel.i686 0:2.6.31.6-145.fc12 set to be installed --> Running transaction check ---> Package glibc-headers.i686 0:2.11-2 set to be updated --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.11-2.i686 --> Processing Dependency: kernel-headers for package: glibc-headers-2.11-2.i686 ---> Package gmp.i686 0:4.3.1-5.fc12 set to be updated ---> Package mpfr.i686 0:2.4.1-3.fc12 set to be updated ---> Package ppl.i686 0:0.10.2-10.fc12 set to be updated --> Running transaction check ---> Package kernel-headers.i686 0:2.6.31.6-145.fc12 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================ Package Arch Version Repository Size ============================================================ Installing: dkms noarch 2.1.0.1-1.fc12 fedora 95 k gcc i686 4.4.2-7.fc12 fedora 8.1 M make i686 1:3.81-18.fc12 fedora 366 k Installing for dependencies: cloog-ppl i686 0.15.7-1.fc12 fedora 81 k cpp i686 4.4.2-7.fc12 fedora 3.3 M glibc-devel i686 2.11-2 fedora 951 k glibc-headers i686 2.11-2 fedora 588 k gmp i686 4.3.1-5.fc12 fedora 308 k kernel-devel i686 2.6.31.6-145.fc12 updates 5.9 M kernel-headers i686 2.6.31.6-145.fc12 updates 741 k mpfr i686 2.4.1-3.fc12 fedora 145 k ppl i686 0.10.2-10.fc12 fedora 1.1 M Transaction Summary ============================================================ Install 12 Package(s) Upgrade 0 Package(s) Total download size: 22 M Is this ok [y/N]: y Downloading Packages: Setting up and reading Presto delta metadata fedora/prestodelta | 1.3 kB 00:00 updates/prestodelta | 166 kB 00:01 Processing delta metadata Package(s) data still to download: 22 M (1/12): cloog-ppl-0.15.7-1.fc12.i686 | 81 kB 00:01 (2/12): cpp-4.4.2-7.fc12.i686.rpm | 3.3 MB 00:38 (3/12): dkms-2.1.0.1-1.fc12.noarch.r | 95 kB 00:01 (4/12): gcc-4.4.2-7.fc12.i686.rpm | 8.1 MB 01:34 (5/12): glibc-devel-2.11-2.i686.rpm | 951 kB 00:10 (6/12): glibc-headers-2.11-2.i686.rp | 588 kB 00:06 (7/12): gmp-4.3.1-5.fc12.i686.rpm | 308 kB 00:03 (8/12): kernel-devel-2.6.31.6-145.fc | 5.9 MB 01:09 (9/12): kernel-headers-2.6.31.6-145. | 741 kB 00:08 (10/12): make-3.81-18.fc12.i686.rpm | 366 kB 00:04 (11/12): mpfr-2.4.1-3.fc12.i686.rpm | 145 kB 00:01 (12/12): ppl-0.10.2-10.fc12.i686.rpm | 1.1 MB 00:13 ------------------------------------------------------------ Total 87 kB/s | 22 MB 04:15 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : kernel-headers-2.6.31.6-145.fc12 1/12 Installing : glibc-headers-2.11-2.i686 2/12 Installing : glibc-devel-2.11-2.i686 3/12 Installing : kernel-devel-2.6.31.6-145.fc12.i 4/12 Installing : gmp-4.3.1-5.fc12.i686 5/12 Installing : ppl-0.10.2-10.fc12.i686 6/12 Installing : cloog-ppl-0.15.7-1.fc12.i686 7/12 Installing : mpfr-2.4.1-3.fc12.i686 8/12 Installing : cpp-4.4.2-7.fc12.i686 9/12 Installing : 1:make-3.81-18.fc12.i686 10/12 Installing : gcc-4.4.2-7.fc12.i686 11/12 Installing : dkms-2.1.0.1-1.fc12.noarch 12/12 Installed: dkms.noarch 0:2.1.0.1-1.fc12 gcc.i686 0:4.4.2-7.fc12 make.i686 1:3.81-18.fc12 Dependency Installed: cloog-ppl.i686 0:0.15.7-1.fc12 cpp.i686 0:4.4.2-7.fc12 glibc-devel.i686 0:2.11-2 glibc-headers.i686 0:2.11-2 gmp.i686 0:4.3.1-5.fc12 kernel-devel.i686 0:2.6.31.6-145.fc12 kernel-headers.i686 0:2.6.31.6-145.fc12 mpfr.i686 0:2.4.1-3.fc12 ppl.i686 0:0.10.2-10.fc12 Complete!
- go to VirtualBox Devices Menu->Install Guest Additions
- mkdir /mnt/cdrom
- mount /dev/sr0 /mnt/cdrom
- cd /mnt/cdrom
- ./VBoxLinuxAdditions-x86.run
- (This stalled on two trials; had to reboot and restart.)
- If upgrading from one VirtualBox version to another, start with fresh virtual disks and machines built with the new versions to avoid breakage.
- reboot
<Terminal log:>
[root@localhost ~]# mkdir /mnt/cdrom [root@localhost ~]# mount /dev/sr0 /mnt/cdrom/ mount: block device /dev/sr0 is write-protected, mounting read-only [root@localhost ~]# cd /mnt/cdrom/ [root@localhost cdrom]# ./VBoxLinuxAdditions-x86.run Verifying archive integrity... All good. Uncompressing VirtualBox 3.0.12 Guest Additions for Linux installation................................................................................................................................................................................................................................ VirtualBox 3.0.12 Guest Additions installation Attempt to remove old DKMS modules... Done. Building the VirtualBox Guest Additions kernel module... Building the shared folder support kernel module... Building the drm support kernel module... Installing the VirtualBox Guest Additions... Successfully installed the VirtualBox Guest Additions. You must restart your guest system in order to complete the installation.
Configure Screen
- Edit /etc/X11/xorg.conf to match the following section: (This is for 1200x900 (XO) and other resolutions.)
Section "Device" Identifier "VirtualBox Video Card" Driver "vboxvideo" EndSection Section "Screen" Identifier "Default Screen" Device "VirtualBox Video Card" Monitor "Generic Monitor" DefaultDepth 16 SubSection "Display" Depth 16 Modes "1200x900" "1024x768" "800x600" "640x480" EndSubSection EndSection
Clear user data
Finally,
- Open Terminal
- Terminal
- rm -rf ~/.sugar (if distributing image)
- su -
- shutdown -h now
- Now you can share the VDI file.
Backup discs
It would be wise to maintain a clone of your virtual disk image to restart if the working copy is damaged:
- From host command line (Windows cmd, or Linux terminal) See VirtualBox Help section 8.14.
- VBoxManage clonehd <uuid>|<filename> <outputfile> [-format VDI|VMDK|VHD|RAW|<other>] [-remember]
- Reclone any virtual hard disks you would like to archive.
SSH connections
To enable SSH communications, we need to permit no passwords in the ssh daemon configuration:
- in Terminal,
- su -
- pico /etc/ssh/sshd_config
- [add] PermitEmptyPasswords yes
- ^O (WriteOut), <Enter> on File Name to Write: /etc/ssh/sshd_config , ^X (Exit)
- service sshd restart