VMware/Preparing a disk image

< VMware
Revision as of 16:32, 22 January 2012 by FGrose (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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



I tried again using the SoaS strawberry release today, but it did do not work either, see below

  1. if you have not downloaded a SoaS iso image yet, start doing it now. It's big.
  2. In VMware, create a new VM.
  3. click "Continue without a disk"
  4. select "Create a custom virtual machine", continue
  5. Choose Operating System Linux and Version Other 2.6.x kernel, continue
  6. click "Customize Settings"
  7. type a name for your virtual machine (e.g., SoaS Strawberry), save
  8. in "Hard Disks", change disk size to 2 GB, click "Apply", go back by clicking "Show All"
  9. in "CDs & DVDs" choose "Use disk image" and select the soas-strawberry.iso you downloaded
  10. you can close the Settings window
  11. select your new VM and start it
  12. after quite a while the Sugar start screen appears. But we're going to use the Linux console.
  13. Hold down ctrl+alt+F2 keys (on a MacBook Fn, too), this switches to a text screen
  14. log in as root (no password required)
  15. init 3 (this stops Sugar for now to free up some memory)
  16. yum install anaconda (this installs the "liveinst" tool)
  17. liveinst
    • this is a graphical tool for installing the iso cd to a harddrive
    • we use it to copy SoaS from the iso image to the virtual disk
    • follow the instructions, re-initializing the drive "sda", partitioned as 256 MB swap and the rest ext3 mounted to '/'

and then the liveinst app just freezes :( so no luck again

This worked for me:

VMware#Soas-Strawberry.iso_installed_to_VM_Hard_Disk (outdated link)

Requires 8 GB hd in 2 GB parts/ to do HD install with livinst....I use RedHat5 for OS but it reinitializes disk anyway; use custom partitions to create ext3 /boot, /, and swap. (satellit06/25/2009)