Using VirtualBox (VBox) with Linux

October 6, 2009

Installing VBox with Linux Host

Installing VBox in Linux host requires the following:

  • Qt 4.3.0 or higher;
  • SDL 1.2.7 or higher (this graphics library is typically called libsdl or similar).

As VBox uses a special kernel module to manage hardware resources, it is recommend to install DKMS:

For Fedora: #yum install dkms

For Ubuntu: $sudo apt-get install dkms

Installing VirtualBox Using YUM

  1. You can now use yum to install VirtualBox.
  2. First you need to download the repository file for yum located at http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo
  3. Then you need to copy the repo file to yum depository folder #cp virtualbox.repo /etc/yum.repos.d/
  4. Make sure dkms is installed as mentioned above
  5. Proceed with the command #yum install VirtualBox
  6. Reboot the PC since kernel file has been modified

Installing Linux as Guest

Installation of Linux is quite easy as long as you stick to the default hardware. Although VirtualBox emulate multiple kind of hardware, some hardware emulation requires additional drivers.

Once the OS is installed, you need to install Linux guest additions for additional functionality such as sharing folders.

To install Linux guest addition, you’ll need GNU compiler, Linux kernel header and a couple of essential software in kernel development. In Fedora, you need to perform yum install as follows:

#yum install gcc kernel-devel

For Ubuntu users, most essential kernel development software has been installed.

Before proceed with guest installation you need to install DKMS

For Fedora: #yum install dkms

For Ubuntu: $sudo apt-get install dkms

Next, you need to mount the CD ISO and proceed to the main folder. Run the appropriate guest addition base on your guest OS and architecture such as:

#./VBoxLinuxAdditions-x86.run or

#./VBoxLinuxAdditions-amd64.run

After installation of guest additions, you can move your mouse freely between guest and host OS. You can expand your screen size by resizing the virtual OS windows.

Sharing Folder with Host System

To share network folders, you need to configure a share folder with a share name in the virtual machine settings.

Then in Linux, you need to mount the share folder using VirtualBox file system:

#mount –t vboxfs name_of_share_folder /mnt/mount_point

please note that the above mounted folder is owned by root.

To allow user to own the files and folder use the command:

#mount -t vboxsf -o uid=1000,gid=1000 name_of_share_folder /mnt/mount_point

If you want to have it mount automatically upon each boot, put the mount command in /etc/rc.local. Using /etc/fstab has little effect, because that  file is processed before the SF module is loaded and will fail to mount the share.

End


Software Virtualization

October 5, 2009

Software virtualization has become popular lately. To solve some of the compatibility issue in Windows 7, Microsoft has incorporated a virtualized Windows XP in Windows 7.

For general user, one the advantages of using software virtualization is, it allows user to run very old application. For example, if you have an application that runs only on DOS, what you need to do is to install DOS on the virtualization software and install the application in the virtual DOS operating system.

As a general user, you can also test other operating system by installing them in the virtualization software. It is now very common for general user to run Windows with virtual Linux. It is more common for Mac users to run Windows operating system in their virtualization software since a lot of applications only runs in Windows operating system. However, you need to purchase additional Windows operating system license.

It is particularly useful for corporate environment, especially in a complex system environment with a mix of UNIX, Linux and Windows. For example, if an application only runs in UNIX, desktop user can install UNIX in their Windows operating system and run the particular application in the virtualized UNIX. Furthermore, virtual operating system can be managed from a virtual server, hence reduce cost in maintaining multiple operating systems. I believe that virtual software market will continue to grow to become an essential part of enterprise architecture. Virtualization software is particularly useful for IT profession in system testing and software development in multiple platform.

There is lots of virtualization software in the market. VM Ware is popular in the corporate environment. For home user, Microsoft Virtual PC is popular with Windows user. Sun’s VirtualBox is available in multiple platforms. Linux users install Xen or VirtualBox.

Microsoft Virtual PC was late in the game in the virtual market; it works well running Windows XP or any earlier version of Microsoft operating system. However, it does not perform well running Linux and it does not provide any integration between host and client OS. Sun’s VirtualBox is the better alternative. Available in multiple platforms, hardware emulation performs better if you install the guest additions.

I have tested a few of the virtualization software mainly VM Ware, Microsoft Virtual PC and Sun’s VirtualBox. For overall usability, I prefer VM Ware and VirtualBox. Please note that you need to purchase the software for VM Ware, and VirtualBox is free for home user.

End.


Running Linux on Sun Virtual Box

October 2, 2009
  • Basically there is no problem running Linux guest in Windows Host using Virtual Box.
  • Besides, Virtual Box also supports vhd used by Microsoft.
  • However, the cloning of hard disk is not straight forward; because each hard disk is assign a UUID. You cannot just do a file copy, instead you need to use its utility tool called “VBoxManage” Use the following command:

C:Program FilesSunVirtualBoxVBoxManage.exe clonehd “Hard Disk 1”.vdi “Hard Disk 2”.vdi

Conclusion:

Although it is not very important but all Linux distribution recognize the emulate sound chip in Virtual Box.

As far as free virtual software is concern, I would prefer Virtual Box from Sun.


Running Linux on Microsoft Virtual PC

October 2, 2009

Microsoft Virtual PC 2007 SP1

  • Runs on Vista, XP and Windows Server 2008
  • Available in 32-bit and 64-bit
  • Virtualization only emulate 32-bit processor, therefore Microsoft Virtual PC 2007 cannot install 64-bit OS as virtual OS (guest OS)

Microsoft Virtual PC

  • Latest version of VPC that supports Windows 7
  • Uses Intel Virtualization Technology, ensure that your PC are equipped with this technology and turn on this function at the BIOS.
  • Available in 32-bit and 64-bit
  • Virtualization only emulate 32-bit processor, therefore Microsoft Virtual PC 2007 cannot install 64-bit OS as virtual OS

Common Problem Installing Linux with Virtual PC

Problem: Processor error; error 13; random error; hang

Solution: add “noreplace-paravirt” in the boot option

Problem: Screen Problem, display problem, video problem. Fedora uses 24-bit graphic mode for installation, MS VPC 2007 does not support 24-bit; it supports 8-bit, 16-bit and 32-bit video. This error will create a processor error.

Solution: add “vga=791” or “vga=0x32D” to the boot option

For my video card the available video mode in virtual PC are (video mode = resolution x color depth):

301h = 640x480x8

303h = 800x600x8

305h = 1024x768x8

307h = 1280x1024x8

320h = 1600x1200x8

314h = 800x600x16

317h = 1024x768x16

31Ah = 1280x1024x16

322h = 1600x1200x16

32Dh = 1152x768x16

312h = 640x480x32

315h = 800x600x32

318h = 1024x768x32

32Eh = 1152x768x32

Problem: Unable to detect mouse, wheel mouse not working

Solution: add “i8042.noloop” and “psmouse.proto=imps”

Problem: Unable to detect sound card

Solution: All Linux solution could not detect VPC emulated SB16. No solutions.

Ubuntu 9.04 Installation Issue on Microsoft Virtual PC 2007 SP1

  • At the startup, the screen will appear scrambled for a while which appears to be a screen problem. However, the screen is alright after a while.
  • You can modify the boot option, although not necessary, if you want to ensure proper screen configuration. At the boot prompt, press F6. Then press Esc. Add “vga=0x32d”after the end of boot line “… splash –”
  • After installation, the OS is fine except there are some scrambled screen during boot up and shut down. You may consider changing boot option although it is not necessary. Boot option for Ubuntu is located at /boot/grub/menu.lst.

Fedora 11 Installation Issue on Microsoft Virtual PC 2007 SP1

  • Fedora uses 24-bit graphic mode for installation, MS VPC 2007 does not support 24-bit. This error will create a processor error.
  • To rectify this problem we need to add the following: vga=0x32d as a boot option
  • After installation of the disk image, you may need to press F8 during boot time to change the boot option again to change the boot option so that you can complete the installation. After F8, type ‘a’ and add ‘vga=0x32d’
  • Note: To permanently add the above to the boot option, locate the file /boot/grub/grub.conf and edit the boot option. Use su root to access the file

Knoppix Installation Issue on Microsoft Virtual PC 2007 SP1

For Knoppix 5.1.0, the mouse is not working after startup, use the following command:

  • knoppix i8042.noloop psmouse.proto=imps

For Knoppix 5.3.1 DVD, if we boot the disc from MS VPC 2007, processor error will occur, use the following to avoid the error:

  • knoppix noreplace-paravirt

Note: Knoppix 5.3.1 could not be booted from VPC using ISO image, use physical disc

Ubuntu 9.04 Installation Issue on Microsoft Virtual PC (Windows 7)

  • At the prompt, press F6. Then press Esc. After the end of boot line “…quiet splash –”add “i8042.noreplace psmouse.proto=imps”
  • After installation to the hard disk and reboot, the mouse is not detected. Adding boot option on the fly does not work either.
  • The solution is to boot without mouse detected. After login, press Alt+F1 to access the menu, select terminal so that you can change the boot option permanently.
  • To permanently add to the boot option, locate the file /boot/grub/menu.lst and edit the boot option. Remember to use sudo to access the file.

Fedora 11 Installation Issue on Microsoft Virtual PC (Windows 7)

  • Fedora uses 24-bit graphic mode for installation, MS VPC 2007 does not support 24-bit. The emulator also fails to detect mouse. To rectify this problem we need to add the following: “vga=0x32d i8042.noreplace psmouse.proto=imps” as a boot option
  • After installation of the disk image, you may need to press F8 during boot time to change the boot option again so that you can complete the installation. After F8, type ‘a’ and add “vga=0x32d i8042.noreplace psmouse.proto=imps”
  • Note: To permanently add the above to the boot option, locate the file /boot/grub/grub.conf and edit the boot option. Use su root to access the file

End