VirtualBox/Preparing a disk image: Difference between revisions

No edit summary
No edit summary
Line 3: Line 3:
Instructions for preparing a VirtualBox disk image from a SoaS iso image file.
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.)
* (Taken from Dave Bauer's posting at http://schools.sugarlabs.org/mod/forum/discuss.php?d=27.)
* Updated 21 May 2010 with [http://www.virtualbox.org/wiki/Downloads VirtualBox 3.2.0] and 64-bit Fedora.
* Updated 09 June 2010 with [http://www.virtualbox.org/wiki/Downloads VirtualBox 3.2.4] and 32-bit Fedora.
==Installing SoaS .iso image==
==Installing SoaS .iso image==
# Create a new VM, choose a name, such as Mirabelle
# Create a new VM, choose a name, such as Mirabelle
# Choose Linux for the Operating System and Version Fedora (64 bit)
# Choose Linux for the Operating System and Version Fedora (use 64 bit, if available)
# Choose Base Memory Size: 256 MB to match an XO-1, 512 or 1024 MB to match an XO-1.5
# 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
# Create a new virtual hard disk image with dynamically expanding storage of 2 GB
Line 17: Line 17:
# Open Terminal.
# Open Terminal.
# su -
# su -
# parted /dev/sda
# parted
# mklabel msdos
# mklabel msdos
#: This makes a partition table.
#: This makes a partition table.
# mkpart primary ext2 0 2048
# mkpart primary ext2 0 2048
#: You will receive this message:<br>Warning: The resulting partition is not properly aligned for best performance.<br>Ignore/Cancel?
#: Enter (I)gnore
# toggle 1 boot
# toggle 1 boot
# quit
# quit
Line 26: Line 28:
# /LiveOS/livecd-iso-to-disk --overlay-size-mb 200 --home-size-mb 200 --delete-home --unencrypted-home /dev/live /dev/sda1<br>(for earlier versions of SoaS
# /LiveOS/livecd-iso-to-disk --overlay-size-mb 200 --home-size-mb 200 --delete-home --unencrypted-home /dev/live /dev/sda1<br>(for earlier versions of SoaS
#: Blueberry - use /media/soas-2-blueberry/LiveOS/livecd-iso-to-disk<br>Strawberry - use /mnt/live/LiveOS/livecd-iso-to-disk)
#: Blueberry - use /media/soas-2-blueberry/LiveOS/livecd-iso-to-disk<br>Strawberry - use /mnt/live/LiveOS/livecd-iso-to-disk)
#* the --overlay-size-mb NNN and --home-size-mb NNN options creates space for persistence of changes on the disk; otherwise, a liveOS disk is read-only. See [[LiveOS image]].
<ul>
#: <br>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.)
{{Show|<Terminal log>
#* 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.)
|<pre>
#* 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).
[root@localhost ~]# parted
#* 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.
GNU Parted 2.1
# shutdown -h now
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos                                                   
(parted) mkpart primary ext2 0 2048
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? I                                                         
(parted) toggle 1 boot                                                   
(parted) quit                                                           
Information: You may need to update /etc/fstab.                         
 
[root@localhost ~]# mke2fs /dev/sda1
mke2fs 1.41.10 (10-Feb-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
125184 inodes, 500000 blocks
25000 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=515899392
16 block groups
32768 blocks per group, 32768 fragments per group
7824 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912
 
Writing inode tables: done                           
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@localhost ~]# /LiveOS/livecd-iso-to-disk --overlay-size-mb 200 --home-size-mb 200 --delete-home --unencrypted-home /dev/live /dev/sda1
Verifying image...
/dev/sr0:  0ce28e3947106fd37bab9317abf09938
Fragment sums: a3c6e5fd5fba11d2b4da71771e8732b63bcb62b841971f7f39ab5c187f64
Fragment count: 20
Checking: 100.0%
 
The media check is complete, the result is: PASS.
 
It is OK to use this media.
Copying live image to USB stick
Updating boot config file
Initializing persistent overlay file
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000150187 s, 0.0 kB/s
Initializing persistent /home
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.0039562 s, 0.0 kB/s
Formatting unencrypted /home
mke2fs 1.41.10 (10-Feb-2009)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
51200 inodes, 204800 blocks
10240 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
25 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
    8193, 24577, 40961, 57345, 73729
 
Writing inode tables: done                           
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
tune2fs 1.41.10 (10-Feb-2009)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Installing boot loader
/media/usbdev.XB8shz/syslinux is device /dev/sda1
USB stick set up as live image!
</pre>}}
* the --overlay-size-mb NNN and --home-size-mb NNN options creates space for persistence of changes on the disk; otherwise, a liveOS disk is read-only. See [[LiveOS image]].
: <br>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 file storage in the /home/liveuser folder.  (In the case where you you want to update the LiveOS image while keeping the user files, skip the new disk creation and parted steps, 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 [[wikipedia:SquashFS|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 for the LiveOS upgrade case.)
</ul>
<ol start=20>
<li> shutdown -h now</li>
</ol>
==Installing VirtualBox Guest Additions==
==Installing VirtualBox Guest Additions==
# Unmount CDROM in VirtualBox settings
# Unmount CD/DVD in VirtualBox settings, select 'Empty' for the CD/DVD device under 'Attributes'
# Mount VBoxGuestAdditions.iso in its place.
# Start the virtual machine
# Boot VM
# Open Terminal
# Open Terminal
# su -
# su -
Line 41: Line 132:
#: (Other dependencies will be called into the installation.)
#: (Other dependencies will be called into the installation.)


<div class="NavFrame collapsed">
{{Show|<Terminal log from 09 June 2010>  
<div class="NavHead">
|<pre>
<yum.log from 21 May 2010:> </div>
[root@localhost ~]# yum install dkms gcc
<div class="NavContent">
<pre>
[root@localhost ~]# yum install dkms gcc make
Loaded plugins: presto, refresh-packagekit
Loaded plugins: presto, refresh-packagekit
fedora/metalink                                                          |  13 kB    00:00     
fedora/metalink                                                          |  13 kB    00:00