Archive

Archive for the ‘virtualization’ Category

How to Install VMware Server on Ubuntu 7.10

September 26th, 2007 63 comments

UPDATE: This tutorial has been updated to half as many steps.  Please use the updated tutorial available:  Installing VMware Server on Ubuntu 7.10 “Gutsy Gibbon” : Updated.

UPDATE: For those running VMware Server 1.0.3 there is an updated version available.

As I mentioned a few posts ago (How to Install VMware Server on Ubuntu 7.04) I would be outlining how to install VMware Server on Ubuntu 7.10. These steps are a bit different from Ubuntu 7.04, as the canonical commercial repository is not up to date with the alpha releases of Ubuntu 7.10. There is a workaround however that can help you get VMware Sever installed.

Installing VMWare Server on Ubuntu 7.10

  1. Download VMware Server source from the VMware website.
  2. Download this installer patch. (source reference)
  3. Extract all the archives to some location on your system (tar -zxvf VMware-server* ; tar -zxvf vmware*)
  4. Ensure that you have build-essential installed in order to compile these sources (sudo aptitude install build-essential)
  5. Install the xinetd server (sudo aptitude install xinetd)
  6. Run sudo ./vmware-install.pl located within the vmware-server-* unpacked archive.
  7. Select all the default options *EXCEPT* do not compile the modules at this point. (Do you want this program to try to build the vmmon module for your system? NO)
  8. Run sudo ./runme.pl located within the vmware-any* archive. This will launch step 8.
  9. Select the default options and this time answer YES to compile the proper modules.
  10. Run vmware-server using the command vmware or via your Applications Menu.

Basically, at this point, VMware Server needs to be installed manually from source until the canonical commercial repository catches up and Ubuntu 7.10 is final. Until then this should work for manually installing.

note: if you update your kernel you will need to re-run the scripts to regenerate and recompile VMware Server for your updated kernel. I’m guessing this close to beta and final releases that we wont have any more kernel updates.. but I’m sure that will soon prove me wrong. Just be aware.

UPDATE: This tutorial has been updated to half as many steps.  Please use the updated tutorial available:  Installing VMware Server on Ubuntu 7.10 “Gutsy Gibbon” : Updated.

Categories: virtualization Tags: ,

How To Install VMWare Server on Ubuntu 7.04

September 12th, 2007 6 comments

UPDATE: This post has been updated for VMware Server 1.0.5 on Ubuntu 8.04.  If you are running Ubuntu 8.04 you’ll need to see those steps.

I’ve been playing more with virtualization recently and thought I would outline the steps I took to install VMWare Server on Ubuntu 7.04.  I will also have steps for installation on Ubuntu 7.10, but it requires a bit more tweaking so that’ll have to wait.

Installing VMWare Server

Installing VMWare Server on Ubuntu 7.04 is made very simple by the Canonical commercial repository.  It’s as simple as an ‘aptitude install’, following just a few steps.  Here is what we need to do:

Register for a VMWare Server use-code.  VMWare Server is freeware but it requires registration at vmware.com to generate a license code for use.  Visit this link to register and generate the number of codes you might want. Remember to print the codes or write them down because in my experience they are not emailed to you.

Include the repository

Add the following line to your /etc/apt/sources.list or via System > Admin > Software Sources menu.

deb http://archive.canonical.com/ubuntu feisty-commercial main

You’ll need to update aptitude to the change using:

sudo aptitude update

Installation

You can now install vmware-server by installing the packages:

sudo aptitude install vmware-server vmware-server-kernel-modules-$(uname -r)

Virtualize

You should now have VMWare Server installed in your Applications menu, or you can launch it via the ‘vmware’ command.  Enjoy.

Categories: virtualization Tags:

Setting up QEMU / KQEMU on Ubuntu 7.04 “Feisty”

July 4th, 2007 10 comments

This post was inspired by my previous post outlining how to bypass a bug in installing Ubuntu 7.10 within QEMU. You may be interested in reading that post as well, Installing Gutsy in QEMU bugfix.

There are many ways to achieve virtualization these days. I’m sure many of you have played with VMware or perhaps Parrallels, etc. It seems we’ve moved (or are moving) toward more and more virtualization on our machines allowing us to do more and more with the hardware. If you haven’t done virtualization yet and you have a machine that is up to the task you’ll definitely want to read on.

Even if you have done virtualization previously you’ll want to check out QEMU and KQEMU. The real open source virtualization projects.

For this tutorial we’ll look at setting up KQEMU, which does have a few requirements. If you don’t meet these requirements you might want to look at the Ubuntu QEMU Wiki for less accelerated virtualization, but still a usable solution.

Can you handle it?

First things first you’ll need to make sure you’re running Ubuntu 7.04 “Feisty” or similar kernel. As far as I understand KVM wasn’t supported until the Feisty release so this may not be an option in earlier Ubuntu versions.

Second you’ll need to make sure your hardware supports KVM. You can get that information from your machine by checking for some flags in /proc/cpuinfo. Use the command as follows. If you see output you’re in good shape. ..if you don’t see anything returned check out the non-KVM solution linked above.

grep -E '^flags.*(vmx|svm)' /proc/cpuinfo

Note: Even if you get no output from the above command, your computer may actually support hardware virtualization. Some machines are delivered with the BIOS option for support switched off. Some other machines require updating to the latest BIOS. This tutorial won’t cover those requirements.

Install the software

If you’ve got the hardware it takes as found above we’re now ready to install the required packages. Get started by installing kvm and qemu, using a command such as:

sudo aptitude install kvm qemu

When that is finished installing you’ll need to insert the appropriate kernel modules for your hardware. If you’re using AMD hardware use the following:

sudo modprobe kvm-amd

or for intel hardware

sudo modprobe kvm-intel

You may need to grant yourself access to the new kvm ‘device’ in /dev. You can use one of the following methods:

sudo chmod 777 /dev/kvm

sudo usermod -a -G kvm $user

sudo useradd $user kvm

(the first of the above options opens full permissions to the file. The second two add your $user to the kvm group, allowing it group-based permissions to the device.)

Create the environment

Now that you’ve got kvm and qemu installed and the proper modules inserted let’s take a second to create our virtual hard drive. One cool thing about virtualization is that you can create, install and run an entire OS from within a single file.

qemu-img create distro.img -f qcow 5G

This command will create a file called distro.img (distro being whatever you’d like to call it) with an available (but not yet used) size of 5G. Replace the distro.img name and file size to your own preference. For basic testing of Ubuntu and other distributions 5G should be plenty.

Now let’s launch up a virtual installer and get things running!

qemu -hda distro.img -cdrom /dev/cdrom | cdrom-image.iso -m 512 -localtime -boot d -soundhw all

Let me break down this command for you as well.

  • -hda tells it the hard drive to use. We’ll want it to use the newly created virtual hard drive, distro.img.
  • -cdrom tells it to use the following device or file location as a cdrom. In this case you can use a physical cdrom in your /dev/cdrom drive itself, or specify a distribution cdrom .iso file.
  • -m 512 tells the virtual machine to be assigned 512M of RAM. This can change based on your needs.
  • -localtime will assign the virtual machine time to your host machines localtime. I have found this optional.
  • -boot d will tell the virtual machine to boot from the cdrom drive. Generally use this for installation only.
  • -soundhw creates and assigns the virtual sound hardware. If you want sound on your virtual machine, use this as well.

This should launch up your virtual machine in a new window, start the installer and go through as normal. If you’ve never installed virtual machines before don’t worry it really is pretty painless. Also, I know some people worry about the partitioning section of the installer. It won’t harm your host machine so create whatever partitions you’d like. It’s completely contained in the virtual image we created previously.

Running the new system

Now that you’ve got your system installed let’s launch the new machine and play around. Did I say play around? I meant do some serious bug testing, of course.

qemu -hda distro.img -m 512 -soundhw all

This more simple line should be adequate to launch your virtual machine. I know the command above was much more complicated, but we do need to tell it to do a bit more for an installation.

You may see an error with this or the above installation command about acceleration layer not activated. If so keep reading, it should be solved with the next step.

Using kqemu for acceleration

Now that we’ve got a basic machine setup and have a basic understanding of using QEMU for virtualization let’s do it right with kqemu, the kvm improved QEMU system.

For this we’ll need to hop through a few more hoops but when you see the performance difference you’ll be glad you did!

We’ll be using a second kernel module for the kqemu system, which has a bit of a workaround. I’m sure it’ll be fixed in gutsy, but currently we have to do some minor tweaking. Again, it’ll be pretty painless and it’s very much worth it!

Insert the kqemu kernel module using:

sudo modprobe kqemu

This should create a device at /dev/kqemu, but it doesn’t, so we’ll take care of that in the next step.

Create a new file at /etc/udev/rules.d/60-kqemu.rules and insert the following:

KERNEL=="kqemu", NAME="%k", MODE="0660", GROUP="kqemu"

Next, change the contents of /etc/modprobe.d/kqemu to the following:

options kqemu major=0

Lastly, add a new group to your system called kqemu and add yourself to it using:

sudo addgroup --system kqemu

sudo adduser $user kqemu

If you didn’t quite follow everything we just did here’s a recap. We created a udev rule that will create the device we need when the kqemu module is loaded. We also customized some of the details of that device, and then added our $user to the group so they’d have permissions to use the new device.

At this point you’ll need to login and log out again to refresh your user permissions and group containment. After you’ve done this try to launch your virtual machine again and see if you notice a difference in performance. On my machine it is very much noticeable and I’m sure you’ll find the same. Again, this section is for those machines that can support the KVM system tested for in the first part of the tutorial.

If you want to automate the sections on loading the kernel modules we need you’ll want to add them to the list of modules automagically loaded at boot. Add new lines for the modules you need in the /etc/modules file, such as:

kvm-intel or kvm-amd

kqemu

Enjoy. By the way, if you read this entire thing I’m very impressed. It turned out much longer than I expected it would, but once I get on a roll I just can’t stop. I hope it was helpful and I hope you’ll take some time to install Ubuntu 7.04 “Gutsy” and help us do some testing. Be sure to report your bugs on launchpad so they can be fixed prior to the final release.

Categories: virtualization Tags: