How to run an OpenSolaris operating system as a guest under the QEMU emulator:
- Grab your favorite distro ISO image.
- Create a virtual disk for the image to install onto. At least 20G for the virtual disk is recommended, so you do not run out of space later.
- Boot the ISO image with at least 512MB of memory for the guest, providing the virtual disk as the first hard disk.
- At the GRUB menu, hit 'e' and 'e' again to edit the default boot options. Append ' -B atapi-cd-dma-enabled=0' to the boot line, press enter, and then hit 'b' to boot the kernel 1(#Notes).
- Install as you would on a real machine, but do NOT select auto-reboot; when the install is completed, stop the virtual machine by closing the window.
- Boot the installed image with at least 512MB of memory for the guest. It is recommended to use 512MB for the guest even if you have a small host machine, as it will be more efficient for the host to page to disk than the client (since all of the paging code has to be run emulated within a guest!).
32-bit host:
$ qemu-img create -f qcow osol.img 20G
$ /opt/SUNWqemu/32/bin/qemu -m 512 -hda osol.img -cdrom myfavdistro.iso -boot d -net nic,model=rtl8139 -net user
...
$ /opt/SUNWqemu/32/bin/qemu -m 512 -net nic,model=rtl8139 -net user osol.img
64-bit host:
$ qemu-img create -f qcow osol.img 20G
$ /opt/SUNWqemu/64/bin/qemu-system-x86~_64 -m 512 -hda osol.img -cdrom myfavdistro.iso -boot d -net nic,model=rtl8139 -net user
...
$ /opt/SUNWqemu/64/bin/qemu-system-x86~_64 -m 512 -net nic,model=rtl8139 -net user osol.img
Notes
- This bit of hackery is required because, while the ATA specification requires that ATA-4 and later (and hence ATAPI) devices support DMA, as of 0.8.2 QEMU does not support ATAPI DMA emulation. The next QEMU release should support ATAPI DMA emulation, allowing this step to be eliminated.
- The -net nic,model=rtl8139 option is required to use the rtls ethernet driver, since the default PCNet emulated adapter is not compatible with the pcn driver. The simulated network interface will appear as 'rtls0' and should be configured using DHCP.
- The -kernel-kqemu option currently does not work with an OpenSolaris guest OS. Patches to the OS itself are required to make this work correctly.
on 2009/10/26 12:17