Difference between revisions of "VMware/Preparing a disk image"

From Sugar Labs
Jump to navigation Jump to search
(Initial version. Does not work fully yet)
(No difference)

Revision as of 09:00, 20 June 2009

Instructions for preparing a VMWare disk image from a SoaS iso image file.

(Adapted from VirtualBox/Preparing a disk image)

These instructions only work up to a point, see below

  1. Create a new VM.
  2. click "Continue without a disk"
  3. select "Create a custom virtual machine", continue
  4. Choose Operating System "Linux" and Version "Other 2.6.x kernel", continue
  5. click "Customize Settings"
  6. type a name for your virtual machine (e.g., "SoaS"), save
  7. in "Hard Disks", change to 1 GB, click "Apply", click "Show All"
  8. in "CDs & DVDs" choose "Use disk image" and select the SoaS iso you downloaded
  9. * http://download.sugarlabs.org/soas/snapshots/2/?C=M;O=D, for Fedora-11-beta.
  10. you can close the Settings window.
  11. select your new VM and start it
  12. Sugar starts, type your name and select a buddy color.
  13. Open Terminal.
  14. su -
  15. parted /dev/sda
  16. *mklabel msdos -- make partition table
  17. *mkpartfs primary ext2 0 1024
  18. *toggle 1 boot
  19. *quit
  20. umount /dev/sda1 -- Soas2-200905241902.iso auto mounts the disk, so unmount it for the next script
  21. /mnt/live/LiveOS/livecd-iso-to-disk --overlay-size-mb 300 --home-size-mb 160 --unencrypted-home --delete-home /dev/sr0 /dev/sda1
    • the --overlay-size-mb NNN option creates space for persistence of changes on the disk; otherwise, a liveOS disk is read-only.
    • 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 sqaushfs 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.
    • don't worry about the script reporting it installed to a USB stick, it actually installed to the 1 GB disk image we created above
  22. poweroff
    • if it warns you about the CD being lock, click "yes"
  23. in the Settings for the VM, under "CDs & DVDs" disable the "Connected" checkbox
  24. start VM again

at this point my VM hung. stuff below not adapted yet

  1. Open Terminal
  2. su -
  3. yum install dkms gcc make ppl binutils glibc-devel glibc-headers kernel-headers kernel-devel
  4. go to VMWare menu->Virtual Machine->Install VMWare Tools
  5. mkdir /mnt/cdrom
  6. mount /dev/sr0 /mnt/cdrom
  7. cd /mnt/cdrom
  8. ./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.
  9. reboot
  10. Edit /etc/X11/xorg.conf to match the following section: (This is for 1200x900 (XO) and other resolutions.)
# Default xorg.conf for Xorg 1.5+ without PCI_TXT_IDS_PATH enabled.
#
# This file was created by VirtualBox Additions installer as it
# was unable to find any existing configuration file for X.
 
Section "Device"
       Identifier "VirtualBox Video Card"
       Driver "vboxvideo"
EndSection
#
# From example in section 4.3.2 of the VirtualBox Help manual:
#
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

Finally,

  1. Open Terminal
  2. Terminal
  3. rm -rf ~/.sugar (if distributing image)
  4. su -
  5. shutdown -h now
  6. Now you can share the VDI file.


It would be wise to maintain a clone of your virtual disk image to restart if the working copy is damaged:

  1. 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]
  2. Reclone any virtual hard disks you would like to archive.


To enable SSH communications, we need to open the firewall for SSH, permit no password for the ssh deamon, and start the sshd service:

  1. in Terminal,
  2. su -
  3. system-config-firewall
    1. close the startup warning dialog
    2. check mark the SSH service
    3. click the apply action button, approve change
    4. File>Quit
  4. pico /etc/ssh/sshd_config
    1. [add] PermitEmptyPasswords yes
    2. ^O (WriteOut), <Enter> on File Name to Write: /etc/ssh/sshd_config , ^X (Exit)
  5. chkconfig --level 345 sshd on
  6. service sshd start