Archive

Archive for the ‘virtualization’ Category

Install VirtualBox on Ubuntu 9.10 “Karmic Koala”

January 15th, 2010 Christer Edwards 4 comments

I am, as I’m sure many of you are, avid users of virtualization. Virtualization allows us to test new releases, other distributions, and otherwise sandbox operating systems and applications that we wouldn’t otherwise be able to (or want to!) run on our stable system. In this article I will outline how to install the latest VirtualBox release using the VirtualBox / Sun repository. This will ensure your installation remains up to date, and stays within the package management system.

Requirements

In order to install the latest VirtualBox release we’ll need to configure and activate the VirtualBox repository. This is done by following the steps below:

  1. (GNOME) Navigate to: System > Administration > Software Sources
  2. (KDE) Navigate to: System Settings > Add and Remove Software > Settings > Edit Software Sources
  3. Select the “Other Software” tab.
  4. Add: deb http://download.virtualbox.org/virtualbox/debian karmic non-free

You’ll also want to import the package signing key, using the command:

wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -

Installation

Once you have the upstream VirtualBox repository activated, you’re able to install the latest VirtualBox release using the command below. You may also click on the linked package name:

sudo aptitude install virtualbox-3.1

Use

Before you are able to use VirtualBox you will need to add yourself to the required group. This facilitates access to the vboxdrv system device. Use the following command to add yourself to the required group:

sudo gpasswd -a <username> vboxusers

Once you have applied this change you will need to logout and log back in. This is required for the group-access change to take effect.

After you are logged back in you should be able to successfully launch VirtualBox from: Applications > System Tools > VirtualBox

How To Convert VMWare Image (.vmdk) to VirtualBox Image (.vdi)

March 22nd, 2009 Christer Edwards 13 comments

I’ve found more and more people are switching to Virtualbox these days and I keep running into the same question.  ”How can I convert my VMware images to Virtualbox images?”  Well, breath easy because it is possible and not very difficult!

There are two methods that I am aware of that will allow you to use your VMware images on Virtualbox.  The first method I’ll outline uses the graphical Virtualbox interface and the second uses the command line. Each method should be equally as stable, it simple depends on your preference.

Method 1

Start Virtualbox
Inside the Virtualbox Menu click: File > Virtual Media Manager
Click on the “Add” button.
Locate and select the VMware .vmdk file you’d like to convert.
Click Open.
Verify your disk image has been added to the list of images and that the virtual and actual sizes appear accurate.
Click OK
Create a new virtual machine profile, selecting your imported image for the storage.
Boot your new virtual machine.

Method 2
To use the second method we’ll need an addition command-line tool called qemu.

sudo aptitude install qemu

You’ll new be able to convert a .vmdk (VMware image) to a .bin format, which can then be converted to a Virtualbox native .vdi format.

qemu-img convert /path/to/original.vmdk converted.bin

You’ll then need to use the VBoxManage utility that comes with Virtualbox to convert the .bin to a native .vdi format:

VBoxManage convertdd converted.bin converted.vdi

You can now create your new Virtualbox machine profile, using this new .vdi file as your disk image.

Two methods for converting VMware images to Virtualbox images.  Are there any other methods that you can suggest, or have you had better experience with one or the other?  Let us know!

Installing Guest Additions on Ubuntu 9.04 “Jaunty” Workaround

March 18th, 2009 Christer Edwards 5 comments

WIN goes to nixternal for pointing out a fix regarding the VirtualBox guest additions installation on Ubuntu 9.04.  Just the other day I installed the latest Ubuntu 9.04 “Jaunty” alpha 6 release and then installed guest additions on the virtual machine.  At that point things went downhill.  I was no longer able to get a graphical session other than “Safe Mode” which, as we all know, isn’t the best.  I had not had time to figure out how to work around it–I honestly tossed it up to a bug in an alpha release–but then nixternal pointed out the fix on his blog.  Again, thanks.

The Workaround

If you’ve attemted to install VirtualBox guest additions within your Ubuntu 9.04 installation and had issues, this workaround should hopefully solve your problems.

  1. Mount the VirtualBox Guest Additions CD.  This is done by clicking “Devices > Install Guest Additions”
  2. Open a terminal (Applications > Accessories > Terminal) and navigate your way to /media/cdrom/
  3. Extract the architecture-specific file using the command: sudo ./VBoxLinuxAdditions-XXX.run --target /tmp
  4. Edit the install.sh file, which should now be sitting in your /tmp directory.
  5. Line 415 (in vim type :415 to jump directly), needs to be changed to: 1.5.99.* | 1.6.0 )
  6. Run: sudo ./install.sh
  7. Reboot

It appears that an upstream patch would be *very* simple, so hopefully this gets fixed before it bites too many people.  In the meantime, I hope this helps anyone that got stuck like I did.

How To Uninstall VMWare Server: Ubuntu All Versions

March 16th, 2009 Christer Edwards No comments

If you’ve ever played with Virtualization products you’ve very likely tried out VMware Server.  With its good support of hardware and software platforms, plus the fact that it is a free download from the VMware website, it is a very commonly used application.  What if you’ve decided to move on to other Virtualization products, such as VirtualBox or KVM?  How do you go about uninstalling VMware Server from your machine?

Uninstall VMware Server

Assuming you’ve followed the tutorials here for installing and configuring VMware Server on Ubuntu your installation is not managed by a debian package.  This means you’re not able to simply use the package management system to remove the installed files and folders.  Luckily, VMware distributed an uninstall utility for completely removing your VMware installation.  To remove VMware Server from your machine simply run:

sudo vmware-uninstall.pl

This should completely remove any installed files, folders or modules installed by the VMware installation scripts. I have found this to work on any Linux distribution I’ve tried so far.

If you’ve tried VMware and you’re ready to try something new, I very much suggest checking out VirtualBox.

Categories: virtualization Tags: ,

VMware Server 1.0.7 on Ubuntu 8.10 “Intrepid” (2.6.27-7-generic)

November 1st, 2008 Christer Edwards 49 comments

UPDATE: These instructions should work for VMware Server 1.0.8 an the 2.6.27-8 kernel as well.

Based on a request in the Ubuntu Tutorials Forum I spent some time this morning researching VMware Server on the new Ubuntu 8.10 release.  Google was quickly helpful, and I was able to get VMware Server 1.0.7 running on a fresh install of Ubuntu 8.10 “Intrepid”.  Here are the steps I took toward getting this installed and working.

Download the dependencies and components

You’ll need to, of course, download the VMware Server .tar.gz file.  This can be done using this command:

wget -c http://download3.vmware.com/software/vmserver/VMware-server-1.0.7-108231.tar.gz

There is also a patch to get this to compile properly.  VMware has regularly been guilty of not keeping up with the latest kernels.  This patch will help correct this problem:

wget -c http://www.insecure.ws/warehouse/vmware-update-2.6.27-5.5.7-2.tar.gz

And the one last thing we’ll need are the compiler tools, which can be installed using this command (or click the package name to use aptURL):

sudo aptitude install build-essential linux-kernel-headers xinetd

Now that we have all of the dependencies and archives downloaded we can unpack them.  In the same location where you downloaded the .tar.gz files (likely your home folder or Desktop), run the following command:

tar xf vmware-update*.tar.gz
tar xf VMware-server*.tar.gz

Installing VMware Server 1.0.7 + patch

We’ll now start the installation.  First we need to install the core vmware application.  We’ll then patch the configuration script, and configure the system.

cd vmware-server-distrib/
sudo ./vmware-install.pl

On my installation I used the defaults until it asked me if I’d like to run the vmware-config.pl configuration script.  At this point select [no].

Once this has finished and you’ve quit at the configuration option, use these commands to patch the config:

cd ../vmware-update*/
sudo ./runme.pl

This script will patch the configuration and then again ask you to run the vmware-config.pl configuration script.  This time around select [yes].  On my installation I selected the defaults for the remaining questions and my installation works fine.

Good luck.  Any issues, give the Ubuntu Tutorials Forum a try.

Categories: virtualization Tags: , , ,

KVM and Virt-Manager On Ubuntu 8.04

June 8th, 2008 Christer Edwards 11 comments

You’ve been seeing a lot of virtualization specific posts recently here at Ubuntu Tutorials.  I’ve been tinkering with a number of virtualization options, namely VMware Server, Virtualbox and now KVM with Virt-Manager.

I’m not going to go into comparing the three in this post, but I will say that KVM is the only solution that will let me run 64bit guests on my 64bit host.  It also cleanly manages networking, whereas VirtualBox still has issues there.  KVM is still fairly new however so the UI features are not as nice as the other two.

Installing The Packages

Assuming your machine will support KVM (generally, core 2 duo and later) lets get the right packages installed.

sudo aptitude install kvm virt-manager libvirt-bin

This will install the Virt-Manager graphical interface for creating and managing your virtual installations.  It’ll also install the kernel module to make use of the KVM instruction set and the libvirt library.

Initial Setup

Once you’ve got the right packages installed you’ll need to give yourself access to the KVM device.  This is done simply enough using:

sudo gpasswd -a username libvirtd

This will require you to logout and login again.  When you get back we’ll get Virt-Manager launched and some virtual machines built.  Go ahead, relogin.  I’ll wait…

Running Virt-Manager

Virt-Manager is a nice kvm/qemu/xen management interface developed by the good folks at RedHat.  This utility makes it really easy to create, manage and delete virtual installations.  You can launch Virt-Manager via the command line, or the Applications menu.

virt-manager

Troubleshooting

If you have VirtualBox installed you may run into conflicts between the kernel modules.  Make sure to remember to remove the conflicting module before you run either of the virtualization solutions.  You can do this by using these commands.

To remove the VirtualBox module:

sudo modprobe -r vboxdrv

To remove the KVM module:

sudo modprobe -r kvm-intel

Enjoy.

Updated: added user to libvirtd group instead of kvm group. Removed launching with sudo.

How To Install VMware Tools on Ubuntu 8.04 Guests

June 7th, 2008 Christer Edwards 29 comments

Installing VMware Tools on virtualized guests gives you a much more enjoyable experience within your virtual environment.  Screen resolution, mouse behaviour, etc will be improved for your virtual sessions after installing these additional tools.  Installing these tools within Ubuntu 8.04 virtualized guests is fairly simple, just follow along below.

Installing VMware Tools

The first requirement, of course, is that you have Ubuntu 8.04 installed within VMware Server and that Ubuntu 8.04 is running.

Once you’ve got your Ubuntu 8.04 guest logged in, navigate to the “VM” menu option (File, Edit, View… VM) and select “Install VMware Tools”.  This will notify you once again that your guest must be logged in.  If that is the case, click “Install”.

note: The next step in the process may be simpler if you make sure any other CD images are unmounted before continuing.

This part of the process mounts a virtual CD image with the VMware Tools contained on it.  To find these tools for installation navigate to Places > Computer > CD Drive.  You should find these two files listed there:

VMwareTools-*.rpm
VMwareTools-.tar.gz

For Ubuntu guest installations we’ll want to use the .tar.gz file.  Now we have access to the needed file, the next part of the process is opening the archive and installing the tools.

Below I’ve put together a copy-paste list of commands you should be able to use to unpack and setup VMware Tools on your Ubuntu 8.04 guest.  All of these commands happen within the Ubuntu 8.04 Guest machine:

sudo aptitude install build-essential linux-headers-generic
cp /media/cdrom/VMwareTools-*.tar.gz /tmp/
cd /tmp/
tar xf VMwareTools-*.tar.gz
cd vmware-tools-distrib/
sudo ./vmware-install.pl

You should be able to safely select the defaults for most of the questions.  You might want to pay attention at the step where it asks for your preferred available resolution and set that properly.  For the new VMware Tools to be available once this process is done you’ll need to reboot your Ubuntu 8.04 guest.  Enjoy.

Install VMware Server 1.0.6 on Ubuntu 8.04 “Hardy”

May 30th, 2008 Christer Edwards 89 comments

Today I needed to setup a couple of virtual machines for a client and realized that I had removed my installation of VMware Server.  Off I went to the VMware download page and what did I find?  A day-old release of VMware Server 1.0.6!  I figured you’d all appreciate an updated blog post on how to install VMware Server 1.0.6 on Ubuntu 8.04, so here we are.  (This is much simpler than the previous post, How To Install VMware Server 1.0.5 on Ubuntu 8.04)

Downloading the Requirements

The first step, of course, is to download VMware Server 1.0.6. You’ll want to download the .tar.gz version.  This command can be used for a direct download:

wget -c http://download3.vmware.com/software/vmserver/VMware-server-1.0.6-91891.tar.gz

The second step is to install some development tools that we’ll need to get things running. Use the following command or click the package names to install the requirements:

sudo aptitude install build-essential linux-kernel-devel linux-headers-generic xinetd

You will also need to generate a serial number to run VMware Server. 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.

OK, at this point we should have all of the requirements, now we can get to work…

Installation and Configuration

Let’s unpack the VMware archive that we downloaded and run the VMware installer.

tar xf VMware-server-1.0.6-*.tar.gz
cd vmware-server-distrib
sudo ./vmware-install.pl

The Last Step

If you attempt to run vmware at this point you might notice that it spits out some nasty errors and complains at you. There is one more thing we need to setup.

Basically VMware is missing and complaining about some cairo libraries and gcc. So, the simple fix for this is to point to them by using a symbolic link:

sudo ln -sf /usr/lib/gcc/i486-linux-gnu/4.2.3/libgcc_s.so /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1
sudo ln -sf /usr/lib/libpng12.so.0 /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0

At this point you should be able to launch vmware and enjoy some virtualization goodness.  Enjoy!

Categories: virtualization Tags: , ,

Install VMware Server 1.0.5 on Ubuntu 8.04 “Hardy”

UPDATE: This tutorial has been updated for VMware Server 1.0.6.  See the updated instructions here, at How To Install VMware Server 1.0.6 on Ubuntu 8.04.

Now that most of the modern world has upgraded to Ubuntu 8.04 I’ve begun to see comments regarding VMware Server no longer working.  You may have used my previous article, Installing VMware Server on Ubuntu 7.10, which has worked great.  Now that 8.04 “Hardy” is installed things have become a bit more complicated unfortunately.

The problem is that VMware has not updated their latest versions to make use of the latest kernel, GCC or gnome libraries.  So, we’ve got two options.

  1. Wait for a new VMware release and hope they patch everything.
  2. Follow the rest of this tutorial and get your hands dirty on the terminal.  We can make it work, but we have to hammer it into submission.

So, I’ll assume because you’re still reading that you’ve opted for the hammer into submission option.  Let’s get started.

Downloading the Requirements

The first step, of course, is to download VMware Server 1.0.5.  You’ll have to agree to the EULA (actually twice.  Once before download and once during installation.  Remember, VMware is free-as-in-beer but not free-as-in-speech.)

The second step is to install some development tools that we’ll need to get things running.  Use the following command or click the package names to install the requirements:

sudo aptitude install build-essential linux-kernel-devel linux-headers-generic xinetd

The third step is to download one more tool to help in the manual build process for VMware Server 1.0.5.  What we need is a script which will help in the custom config hosted at Google Code.  Download the vmware-any-any-update-116.tgz.

You will also need to generate a serial number to run VMware Server.  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.

OK, at this point we should have all of the requirements, now we can get to work…

Installation and Configuration

Let’s unpack the VMware archive that we downloaded and run the VMware installer.  NOTE: After some basic configuration it will ask you to run vmware-config.pl.  DO NOT RUN vmware-config.pl, WE ARE NOT READY YET.

tar xf VMware-server-1.0.5
cd vmware-server-distrib
sudo ./vmware-install.pl

When it asks you to run vmware-config.pl you want to answer “no” and this is where the vmware-any-any-116.tgz patch comes in.

cd ..
tar xf vmware-any-any-update-116.tgz
cd vmware-any-any-update116
sudo ./runme.pl

After this runs it will ask you again if you want to run vmware-config.pl.  At this point select “yes”.

The Last Step

If you attempt to run vmware at this point you might notice that it spits out some nasty errors and complains at you.  There is one more thing we need to setup. (Hey, VMware, if you’re reading this will you please incorporate these fixes into your official download already!)

Basically VMware is missing and complaining about some cairo libraries and gcc.  So, the simple fix for this is to point to them by using a symbolic link:

sudo ln -sf /usr/lib/gcc/i486-linux-gnu/4.2.3/libgcc_s.so /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1
sudo ln -sf /usr/lib/libpng12.so.0 /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0

At this point you should be able to launch vmware and enjoy some virtualization goodness.  Please stay tuned for virtualization updates regarding virtualbox and the new KVM!

sources: I want to throw a big thanks to my buddy Igor for helping figure out these tweaks.  Check out his blog, with these and other instructions, here.

UPDATE: based on some of the comments below I’ve added the “-f” to the symbolik link options.

Categories: virtualization Tags: , , ,

How To Do Seamless Window and Folder Integration with Ubuntu & VirtualBox

February 1st, 2008 Christer Edwards 34 comments

As promised in yesterdays post I’m going to outline today how to setup seamless window integration with Ubuntu and Virtualbox. If you missed yesterday’s post you might want to take a look at the seamless integration screenshot. No, that is not Photoshop’d, its really my desktop. I’ll also outline how to setup a shared folder between the two systems so that the icons and folders available on your XP desktop are available on your Ubuntu dekstop. So lets go ahead and dive in.

Installing VirtualBox

If you’ve already got VirtualBox installed you can skip ahead here down to Activating Seamless Integration. If not we’ll be starting you from scratch. Fortunately Ubuntu has packages for VirtualBox available in the repositories. I have a previous post on installing VirtualBox, but we’ll repeat the steps here:

sudo aptitude install virtualbox-ose virtualbox-ose-modules

This’ll install VirtualBox Open Source Edition, and should take just a few minutes.

After the installation is finished you’ll need to do just one of the following.

  • Add yourself to the vboxdrv group (sudo usermod -G vboxusers -a username), and then re-login.
  • change permissions on the vboxdrv device (sudo chmod 666 /dev/vboxdrv)

You should now have VirtualBox listed in your Applications menu (Applications > System Tools > Innotek VirtualBox). Go ahead and launch this and install Windows. (I wont get into details on Windows installation, I’m hoping you can figure that much out on your own.)

Activating Seamless Integration

With the release of VirtualBox 1.5.0 (the version you just installed via the Ubuntu repositories) Innotek added the seamless integration feature. This is similar to what is available on Parallels on Mac, allowing you to run individual applications from a virtual environment seamlessly on your native desktop.

Once your guest machine is running and logged in you can activate seamless mode via a shortcut key. Now I want to note that you might double-check to see what your “Host Key” is set to before you dive into this. This proved problematic for me on my MacBook as the default key is right-ctrl, but there is no right-ctrl on the MacBook.

Navigate to (File > Preferences) inside the main VirtualBox window, select the “Input” option and verify or set your “Host” Key” before you go forward.

You’ll also need to install Guest Additions on the Windows guest for this to be available.  See the mention in the next section on how to do that.

Once you’re sure what your “Host Key” is, go back into your running Windows guest and activate seamless mode by hitting:

"Host Key"+L

This should make everything but the Start menu disappear, allowing you to launch individual applications as you normally would. You may want to move your bottom gnome panel to the top for better integration.

Configuring Shared Folder Integration

One additional thing you might want to setup is shared folder integration. What I mean by this is having the files from your Ubuntu desktop appear on your Windows desktop as well. This might be useful, for instance, if you launched Internet Exploder via your integrated Start menu and downloaded a file. The saved file would then appear on your native Ubuntu desktop, via the shared folder system.

First we’ll need to install the VirtualBox Guest Additions. I haven’t yet blogged about how to do this on Windows guests, but you might refer to my previous post on Installing Guest Additions for Ubuntu Guests. Hopefully this’ll be enough until I write a proper article on the topic.

Next activate virtual shared folder support in your guest OS (Windows). Do this via the main VirtualBox window, selecting (Machine > Settings > “Shared Folders”). Click the button to add a shared folder (the top right icon), and define the path to your share. You’ll likely want to share your current Desktop, so you might select:

/home/username/Desktop

Now, toggling back to your Windows guest, you’ll want to mount this shared folder. You’ll need to open a shell using (Start > Run > “cmd“). Then use the following command to “mount” this shared folder between your Ubuntu host and your Windows guest.

net use x: \\vboxsvr\Desktop

You should now have access to your shared folder, but we also want to tell Windows to use this as its primary folder.

Start up regedit via (Start > Run > “regedit“) and navigate to the following location:

(HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Explorer > User Shell Folders)

Look for the key “Desktop” and change the value to:

x:

Save your changes, reboot your Windows guest and you should be done.

I realize this post ended up a bit longer than I expected, but hopefully its comprehensive enough to make it easy to follow. I am really impressed with VirtualBox Open Source Edition, and this even improves my opinion of it!

Categories: virtualization Tags: , ,