updated: 13.july.2009
Moma's notes.

Various virtualization solutions for Ubuntu 9.04 (Jaunty Jackalope)


A) VMware Player

VMware Player...

Study https://help.ubuntu.com/community/VMware

A1)
Ok, let's start.
Install first some prerequisites (pre-requirements).
$ sudo aptitude update
$ sudo
aptitude install build-essential linux-headers-generic linux-headers-$(uname -r) xinetd
----------

A2) Create a working folder and cd there.
$ mkdir $HOME/vmware
$ cd $HOME/vmware
----------

A3) Download VMware Player from http://www.vmware.com/download/player/
wget guarantees a safe download.


Depending on your system, get a 32 bit version
$ wget -c http://download3.vmware.com/software/vmplayer/VMware-Player-2.5.2-156735.i386.bundle

Or download the 64 bit version (use uname -m command to check bitziness of your system; it should report either x86_64 or i686/i386 )
$ wget -c http://download3.vmware.com/software/vmplayer/VMware-Player-2.5.2-156735.x86_64.bundle

Important: Check the website and pick the most recent version of the product.
(the webpage may require you to register with your name and email address)
----------

A4) VMware cannot run if the Linux's KVM virtualization module is loaded. Unload KVM before installation.
List all KVM modules
$ lsmod | grep kvm

And unload them (the listed modules). Use modprobe -r or rmmod commands.
sudo modprobe -r kvm_intel kvm_amd kvm
or run
$
sudo /etc/init.d/kvm stop
----------

A5) Then install VMWare Player
Eg. I downloaded the "
VMware-Player-2.5.2-156735.x86_64.bundle" package. Install it by typing
$ sudo bash VMware-Player*bundle

It should tell you when the installation has completed.
VMware Player installed successfully
See picture A5.

----------

A6) Test it
$ vmplayer

VMware Player installed successfully
See picture A6.
---------

But for now, quit the vmplayer because we need to donwload some guest operating systems first. Move to step B).



B) Download guest operating systems

Downloading and running guest operating systems in VMware Player.

These are the most common download sites for ready-made VMware images:

http://www.vmware.com/appliances/

http://vmplanet.net/

http://www.thoughtpolice.co.uk/vmware/


B0) Some of the images are compressed as 7-zip file archives. Therefore install
p7zip tools first.
$ sudo aptitude install p7zip p7zip-full
----------

B1) Then search for guest images.

I want to test the latest Fedora 11 development release, so I browse to
http://www.vmware.com/appliances/ and search for "fedora 11". 

It leads me to http://www.vmplanet.net/node/82

Important: Read the entire description so you get known what the user names and passwords are. It this particular case it says
Login: vmplanet
Pass: vmplanet.net
RootPass: vmplanet.net

Ok, start the download. Use the torrent method if possible. It is rather quick and 100% reliable.
In this case you should download the "Fedora11A.7z...." file.
----------

B2) For the sake of tidiness (order), lets gather all guest OSes in the same sub directory.
Create an "images" directory under your $HOME/vmware/ folder.

$ cd $HOME/vmware
$ mkdir images
$ cd images
----------

B3)  You should uncompress the Fedira11A.7z file to $HOME/vmware/images/ folder.

If you do not succeed to unpack/unzip it in file manager, try this command.
$ 7z e /tmp/Fedora11A.7z -o
$HOME/vmware/images/

In my case it had put the file to /tmp/ folder.
The file is huge so it will take some time...
----------

B4) Now check the resulting directory and files.

$ cd $HOME/vmware

$ ls -lR
The listing should look like this

./images/Fedora11A:
-rw------- 1 moma moma 2147221504 2009-02-06 13:52 Fedora 11 Alpha-f001.vmdk
-rw------- 1 moma moma 2147221504 2009-02-06 13:52 Fedora 11 Alpha-f002.vmdk
-rw------- 1 moma moma 2147221504 2009-02-06 13:52 Fedora 11 Alpha-f003.vmdk
-rw------- 1 moma moma 2147221504 2009-02-06 13:52 Fedora 11 Alpha-f004.vmdk
-rw------- 1 moma moma    1048576 2009-02-06 07:12 Fedora 11 Alpha-f005.vmdk
-rw------- 1 moma moma       8684 2009-02-06 13:52 Fedora 11 Alpha.nvram
-rw------- 1 moma moma        618 2009-02-06 13:45 Fedora 11 Alpha.vmdk
-rw------- 1 moma moma          0 2009-02-06 07:12 Fedora 11 Alpha.vmsd
-rwxr-xr-x 1 moma moma       1547 2009-02-06 13:44 Fedora 11 Alpha.vmx
-rw------- 1 moma moma        270 2009-02-06 07:12 Fedora 11 Alpha.vmxf
-rw-r--r-- 1 moma moma     205831 2009-02-06 13:44 vmware-0.log
-rw-r--r-- 1 moma moma      53026 2009-02-06 13:52 vmware.log


Looks good to me mama. But what are the
Fedora 11 Alpha-f00?.vmdk files ? Are they saved snapshots or what?

You can now delete the downloaded zip file (in this case Fedora11A.7z ).
----------

B5)  Start the guest OS in the vmplayer.

Now, start vmplayer from the command line or from the menu. You should find it in Applications -> System Tools menu.
$ vmplayer

Click the [Open an existing Virtual Machine] button and pick the "Fedora 11 Alpha.vmx" image from the
$HOME/vmware/images/ directory.

Picture B5-1: Start it.
Run SuSE 10.3 beta in VMWare Player

If it asks where you got the image, answer "I copied it".

Picture B5-2: Login with the given password and username.
Login: vmplanet
Password: vmplanet.net
Run SuSE 10.3 beta in VMWare Player

----------

B5) Create and put a shortcut icon on the desktop or toolbar

First, check which command line arguments vmplayer can take.
vmplayer --help

(note: the
-X argument for full screen may be useful )

So in this case, the command line will look like this (replace the file location if it's different).
$ vmplayer "$HOME/vmware/images/Fedora11A/Fedora 11 Alpha.vmx"

Create an icon on the desktop and set the command.  Drag & drop it onto the toolbar for quick access.
----------

Avoid the KVM module error.
If you play with both KVM (Linux' kernel based virtual machine) and VMWare Player so do not forget to unload the KVM module before starting VMWare.
$ sudo /etc/init.d/kvm stop   # stop | start | restart
or do it graphically
$
gksudo /etc/init.d/kvm stop
----------

B6) Download and test other Linux distributions.  Go to step B1).

Boa viagem & good luck.

The end.
----------

Literature:
https://help.ubuntu.com/community/VMware

VMWare Tools: https://help.ubuntu.com/community/VMware/Tools

VMWare Server: http://www.bauer-power.net/2009/03/how-to-install-vmware-server-2-on.html
+ http://www.howtoforge.com/how-to-install-vmware-server-2-on-ubuntu-9.04

Use SUSE Studio... to build your appliances.

Easyvmx.com



C) VirtualBox

Virtualbox...

Ubuntu's package archive has a ready-made "virtualbox-ose" package..., but I will here show you how to download and install the very latest version from the http://www.virtualbox.org. The new VirtualBox 3.0 supports guests with symmetric multiprocessing (SMP) up to 32 virtual CPUs. It also brings OpenGL 2.0 graphics acceleration technology to VirtualBox.

C1) Get first some pre-requirements.
$ sudo aptitude update
$ sudo aptitude install build-essential linux-headers-generic libqtgui4 python2.5
----------

C2) Download the latest VirtualBox

Make a temporary working directory
$ mkdir $HOME/tmp
$ cd $HOME/tmp

Browse to http://www.virtualbox.org/wiki/Downloads  and locate the most recent version of VirtualBox.

Follow the 
VirtualBox 3.0.6 for Linux hosts... link and look for line "Ubuntu 9.04 ("Jaunty Jackalope") I386 | AMD64"

You can either download the ready made .deb package or the binary .run file. I prefer the .deb package here because it's easier to install and remove.
Check the website before download because new versions come out quite often.

The I386 version is for 32bit and AMD64 is for 64bit Ubuntu on all Intel/AMD compatible processors.

Just click on the link and let the package manager handle it, or do it manually with wget and dpkg as shown here.

Notice:
The installation page... provides also a repository line for Ubuntu 9.04 (Jaunty). If you know how to add the repository entry to your /etc/apt/sources.list file, then do it and install VirtualBox 3.x via Synaptic Package Manager or command line.
Ubuntu will then keep your VirtualBox up2date via the repository.


I will not use the repository method here, but will fetch the 64bit .deb package directly (I will need to take care of later updates myself, but that's OK).
Fetch the .deb package.
$ wget http://download.virtualbox.org/virtualbox/3.0.6/virtualbox-3.0_3.0.6-52128_Ubuntu_jaunty_amd64.deb

----------

C3) Install the .deb package

Notice:
VirtualBox 3 was released in July 2009. You should uninstall any older version first. Uninstallation will not remove your guest VMs.
$ dpkg -l | grep virtualbox
$ sudo aptitude remove virtualbox-2.2


Install the new VirtualBox 3 package
$ sudo dpkg -i
virtualbox-3*.deb*
$ sudo aptitude install -f

Say YES if it asks "Should vboxdrv kernel module be compiled now?"
Press TAB-key or ARROW-keys to move the cursor in the text window.

See picture
VirtualBox
----------

C4) Add your user name to vboxusers group. Replace $USER with your user/login name if you like.
(I think this step was done automatically by the installer, but let's still repeat it)
$
sudo usermod -a -G vboxusers $USER
----------

C5) Note: The current session does not know about the new group or change unless you logout / in.
Save your data and log out and in.

Note: You can easily check which groups you belong to. Type
$ groups
----------

C6) Start VirtualBox
$ VirtualBox
----------

C7) Study the fine manual
$ evince /usr/share/doc/virtualbox-3.*/UserManual.pdf


See also: http://www.virtualbox.org/wiki/Documentation

----------

C8) Run guest operating systems in VirtualBox

I will here show how to install a new operating system from an iso-file:
Create a new Virtual Machine and attach iso-file to the CD/DVD ROM device. See the menu selection Machine -> Settings,  CD/DVD ROM.

Study these pictures

Define quest OS

Define quest OS

Define iso (cd) image as an installation source.
Define quest OS

Detach the iso-file from the CD/DVD ROM after successful installation so it will boot from the (virtual) harddrive, not from the iso-image.
----------

And finally, VirtualBox is running the amazing Fedora 10 distro (LiveCD).
Conflict with KVM module
Click the icon to install it on the (virtual) harddrive you just defined.
----------

C9) Unload the KVM module before you start guest OSes.
Note: Guest operating systems in VirtualBox cannot run if the KVM virtualization module is loaded.
You will likely see this error message.
Conflict with KVM module

The solutions is to remove the KVM moule.

List all KVM modules
$ lsmod | grep kvm

And unload them (the listed modules). Use modprobe -r or rmmod commands.
$ sudo modprobe -r kvm_intel kvm_amd kvm
or run
$
sudo /etc/init.d/kvm stop
----------

Ungrabbing keyboard and mouse:
To escape from the VirtualBox, press the CNTR key at the RIGHT side of the keyboard. Ok?

----------
---------- ---------- ---------- ---------- ---------- ---------- ----------

C10) Install Guest Additions

Guest Additions come with an improved video driver that gives better performance and features such as dynamically adjusting
the resolution when the window is resized. You can also run applications in Seamless windowing mode...

Note: Guest Additions is a feature of the guest operating system (not of the host).
Guest Additions are installed within the guest OS, not on the host !

C10-1) Installation requires kernel-headers and gcc compiler packages.
In Fedora guest you should install (yum) kernel-headers, kernel-devel and gcc packages.

In Ubuntu guest you will need the build-essential and linux-headers-$(uname -r)
packages.

My guest OS here is Fedora 10, therefore I will first read this guide http://fedorasolved.org/Members/realz/VB_Guest_Addition


then I login to the
guest and install the required modules

$ su -c "yum install kernel-headers kernel-devel gcc"

See picture:
Conflict with KVM module

----------

C10-2) Download Guest Additions.
Ask VirtualBox to download the Guest Additions by selecting Devices -> Install Guest Additions from the menu.
See picture:
Conflict with KVM module

----------

C10-3) Wait until the download is ready.
VirtualBox will download and make the files available under the /media directory. It actually creates a kind of storage/cdrom device which is then mounted under /media.
Notice: The download may take some time.

After a few minutes time my Fedora guest reported that it got a new device which is mounted under /media.
See picture
Conflict with KVM module

----------

C10-4) Install the Guest Additions.
In the guest OS, start a terminal window and cd into the installation directory (in /media/VB* or /media/cdrom )
VirtualBox 3.0 seems to mount the guest additions to
/media/cdrom.

$ cd /media/cdrom
(in the older VirtualBox 2.x it might be)
$ cd /media/VB*

Now check the files
$ ls -l
Should report this
Conflict with KVM module
Notice:
Sometimes VirtualBox fails to mount the Guest Additions directory. Let's say you fired the "Devices" -> "Install Guest Additions" selection several times but nothing seemed to happen. Try this:

1) Create a mount directory if not already present (do as root or sudo).
mkdir -p /media/cdrom
2) Use "ls -l" and look for /dev/disk/by-label/VBOXADDITIONS* devices
ls -l
/dev/disk/by-label/VBOXADD*

3) Then mount it (as root or sudo). Eg. in this case i do
mount /dev/disk/by-label/VBOXADDITIONS_3.3.0_49315 /media/cdrom
4) Cd into the /media/cdrom
cd /media/cdrom

And install the additions as shown below.
(umount the /media/cdrom directory after usage)

Run the correct script/module.
On 32bit Linux, run "
VBoxLinuxAdditions-x86.run" and on 64bit Linux run "VBoxLinuxAdditions-amd64.run".
If in doubt, check bitziness with "uname -a" or "uname -m" commands.

My Ferora 10 guest is of X86_64 breed, so I'll run (run it as root or sudo)
$ su -c ./VBoxLinuxAdditions-amd64.run

You should see the following when the installation is complete.
Picture: Additions in the Fedora guest.
Guest additions

Here is a similar situation when the guest OS is Ubuntu.
.
Guest additions in Fedora
Download the Additions from Devices -> Install Guest Additions menu and install as sudo (super user/root).
----------
C10-5) Reboot your guest OS.
Now your guest should have much higher screen resolution and other improved features ! 
Resize your window.
See picture
Conflict with KVM module
----------
C10-6) OpenGL in VirtualBox
VirtualBox 3.0 comes with OpenGL graphics support.
You should enable OpenGL
3D acceleration in the Settings -> Display dialog.
See this picture
Enable OpenGL in VirtualBox 3

Then
start your guest and test the OpenGL 3D support with

$ glxinfo | grep -i direct
It should report "Yes" if direct rendering (OpenGL 3D support) is activated.

Further test it with
$ glxgears

See picture (OpenGL test in Ubuntu 9.04 guest OS)
OpenGL in VirtualBox 3

----------

Literature:
Important reading: https://help.ubuntu.com/community/VirtualBox

Run-windows-apps-seamlessly-inside-linux

Guides:
Install VirtualBox 3.0 in Ubuntu 9.04...

Installing-guest-additions-for-ubuntu-guests-in-virtualbox  

Convert between virtual image formats
Convert VirtualBox image to KVM...

Convert VMware image to....

Run Google's Android in VirtualBox
http://www.edbl.no/tmp/AndroidLive

Other good examples...

D) KVM virtualization

KVM (Kernel based Virtual Machine)....

KVM... is a virtualization solution for Linux on x86 / X86_64 hardware.
It requires a virtualization harnessed CPU type; Intel VT or AMD-V.

EDIT: Ubuntu has already an execellent KVM-guide. Check it first !
https://help.ubuntu.com/community/KVM


If you are still
here, continue reading...

D1) First, check if your computer's processor supports KVM.
Read:
How_can_I_tell_if_I_have_Intel_VT_or_AMD-V....
Run this command and If something shows up, you have a Intel's VT(vmx) or AMD's SVM capable CPU. 
$ egrep '(vmx|svm)' --color=always /proc/cpuinfo

If nothing is printed, it means that your CPU doesn't support hardware virtualisation.
Check also that virtualisation is enabled in the BIOS.

----------
D2) Install Virtual Manager GUI and KVM + QEMU

$ sudo apt-get install virt-manager libvirt-bin kvm qemu

----------
D3) Add  your user name to the libvirtd group. You can replace $(id -un) with your user name.  
Run command

$ sudo usermod -aG libvirtd $(id -un)

----------
D4) Reboot your computer.
I got som errors in the VirtManager before I re-booted so I suppose reboot is necessary.
Reboot will propably load the kvm (and kvm-intel or kvm-amd) modules.
----------

D5) Start the VirtManager from the menu
But first, check if the KVM module is loaded at computer startup.

$ lsmod | grep kvm
should report:

kvm_intel (or kvm_amd)    57824  1
kvm                               176624  1 kvm_intel

If the listing is empty, then load the kvm module manually. Run

$ sudo /etc/init.d/kvm start
And re-check the result with lsmod

Note: You can also use modprobe and modprobe -r to load/unload the modules.

Now start the KVM Virtual Manager from Applications -> System Tools menu.
See picture 
Conflict with KVM module

You can also start it from the command line with
$ virt-manager
----------

D6)  Install a new guest operating system.

I will here use Fedora 10 as an example and install it from an iso-image (
F10-x86_64-Live-KDE.iso).

D6-1) Press the [New]-button
See picture
Conflict with KVM module
And give the guest session a name.

D6-2) Set the virtualization method
See picture

Conflict with KVM module

D6-3) And installation method
I will here install Fedora from an iso-image so I will choose the "Local install media".
Select also the type of operating system, in this case Linux and Fedora 10.

See picture
Conflict with KVM module

D6-4) Installation media
Here I will choose the "ISO image location" which I point to
my (just downloaded) /media/sda6/download/F10-x86_64-Live-KDE.iso.
The other option lets you install a new guest operating system from CD or DVD.
See picture
Conflict with KVM module

D6-5) Define the storage (virtual harddrive).
Choose location and name of the virtual harddrive.
I will here give Fedora 5GB of harddisk space. Minimum would be around 2.6 - 3GB.

See picture

Conflict with KVM module

D6-6) Memory and CPU allocation. 
This Fedora 10 image is a LiveCD with the KDE desktop.
It requires at least 700MB memory to run well. I tried 512MB but the guest was sluggish.

I will here give Fedora guest 750MB RAM and 2 processors.
See picture

Conflict with KVM module

D6-7) Finish the virtual machine creation.
Read the summary and complete the definition.
See picture

Conflict with KVM module
It will now format/prepare the virtual harddrive.

D6-8) Install the guest into the virtual harddrive.
It should automatically boot from the iso-image but if it does not, click the [Run] button to start the guest.

As said, this example will run from the Fedora's iso-image.

Click the installation icon on the guest's desktop and install Fedora 10 (or any other distro) you chose to play with.
See picture

Conflict with KVM module

Complete the installation of guest.

----------
This is after you've installed the guest successfully.

D7)
Make the guest to boot from harddrive (not from the cdrom or iso-image).

In the previous steps, Fedora's iso-image was set as a boot-media.
But the installation is now complete and I wish it to boot from the virtual harddrive.

D7-1) Shutdown your guest OS.

D7-2) Browse to [Hardware] tab-page and choose "Disc hdc" or equivalent cdrom device.
[Disconnect] the iso-image from the device.
See picture

Conflict with KVM module

D7-3) And make it to boot from its hard disc.

In the "Boot Options", select "Hard disk" and press the [Apply]-button.
See picture
Conflict with KVM module

And your guest is ready boot from its harddrive.
Press the [Run]-button to start the guest.
----------

You can easily start your guest from command line. Eg. try the following command.
Replace the image path/name with yours.
-m 750
means memory, -boot c means boot from primary hard disc.

$ kvm -m 750 -boot c -soundhw sb16 -net nic -net user $HOME/KVM/KVM-Fedora10.img

You can try various sound devices (
-soundhw). This command will list them all
$ kvm -soundhw list

Study also KVM's manual...
$ man kvm
and
$ kvm -h
----------

Literature:

http://www.linux-kvm.org/page/Main_Page

https://help.ubuntu.com/community/KVM
https://wiki.ubuntu.com/kvm

Installing_and_Configuring_Fedora_KVM_Virtualization

http://www.howtoforge.com/virtualization-with-kvm-on-ubuntu-9.04
http://virt-manager.et.redhat.com

An introduction to KVM and Lguest (IBM)...


-- the end --

Go back to http://www.futuredesktop.org