Archive

Posts Tagged ‘virtualbox’

Install Guest-Additions on Ubuntu 10.10 Beta : Workaround

September 8th, 2010 9 comments

I took some time today to check out Ubuntu 10.10 Beta. So far I’m impressed with some of the improvements, and I’ll blog about those later, but in the meantime I thought I’d share a workaround I came across in getting Guest Additions working when running Ubuntu 10.10 inside VirtualBox.

My first attempt at getting Guest Additions installed was by mounting the CD and running the command:

sudo ./VBoxLinuxAdditions-x86.run

While this attempted to compile the drivers necessary for Guest Additions, it never seemed to work. After repeated reboots and rebuilds, I could never get a better resolution. After a little searching I came across a solution that seems to take care of the problem.

To install Guest Additions in Ubuntu 10.10 Beta, you’ll need to install a pre-packaged version available through the repositories. You can run the command below, or click on the URL:

sudo apt-get install virtualbox-ose-guest-x11

After a quick reboot you should be set.

I hope you enjoy Ubuntu 10.10 Beta (and forward). It’s the little things like this that make testing it in a virtual machine worthwhile.

Install VirtualBox Guest Additions on VirtualBox Guests

June 26th, 2010 4 comments

I thought I would share a little bit more from the book I reviewed, “VirtualBox 3.1 Beginners Guide“. This book outlines the process of installing Guest Additions on your virtual machines. Guest additions allow you to greatly improve your experience when working inside virtual machines. Improved mouse and keyboard integration, improved video resolution and more! VirtualBox Guest Additions are a basic requirement for anyone wanting to properly run virtual machines in a graphical environment.

In this article I will outline how to install VirtualBox Guest Additions on Windows and Linux virtual machines. If you have not previously run a Virtual Machine with Guest Additions, you’ve been missing out!

Prerequisites

This article assumes, of course, that you already have VirtualBox and a Virtual Machine installed. You’ll find instructions below for both Windows and Linux guests.

Install VirtualBox Guest Additions on Windows

To install VirtualBox Guest Additions, you’ll first need to boot and log into your Virtual Machine. In this case, launch your Windows Virtual Machine and follow these steps:

VirtualBox Guest Additions

  1. In the VirtualBox menu of your running Virtual Machine, under Devices, select “Install Guest Additions”.
  2. Follow the prompts for the VirtualBox Guest Additions Setup.
  3. Reboot the Virtual Machine when prompted.
  4. Enjoy!

You can always verify whether or not VirtualBox Guest Additions are installed in your Virtual Machine by looking in the system tray. If you see a small VirtualBox icon, VirtualBox Guest additions is installed an running properly.

Install VirtualBox Guest Additions on Linux

These instructions should apply to most Linux distributions. It is not limited to Ubuntu Virtual Machines.

To install VirtualBox Guest Additions, you’ll first need to boot and log into your Virtual Machine. In this case, launch your Linux Virtual Machine and follow these steps:

  1. Ensure you have the ‘build-essential’ and ‘dkms’ packages installed in the Virtual Machine. This is required to compile the kernel modules required.
  2. In the VirtualBox menu of your running Virtual Machine, under Devices, select “Install Guest Additions”.
  3. This may prompt you with an auto-run prompt as it loads the CD image. You can skip this as you’ll need to run the installer from the Terminal.
  4. Open a Terminal and navigate to the VBOX* directory under /media.
  5. * Run: sudo ./VboxLinuxAdditions-x86.run
  6. If everything runs according to plan, you’ll be prompted to reboot your Virtual Machine.
  7. Enjoy!

* Note: step 5 allows for 32bit or 64bit installations. If your Virtual Machine is a 64bit, run the ./VboxLinuxAdditions-amd64.run instead.

You can always verify whether or not VirtualBox Guest Additions are installed in your Virtual Machine by looking in the system tray. If you see a small VirtualBox icon, VirtualBox Guest additions is installed and running properly.

Conclusion

After installing VirtualBox Guest Additions you’ll notice a great improvement in your Virtual Machine experience. You’ll have much better mouse and keyboard integration, improved video resolution, the ability to run in Full Screen and Seamless Window Integration, and much more. VirtualBox Guest Additions are required for anyone regularly running Virtual Machines, whether Windows or Linux.

Note: I found this for those wishing to install VirtualBox Guest Additions on Fedora.

VirtualBox 3.1 Beginners Guide : Review

June 20th, 2010 2 comments

I am a big fan of VirtualBox as a desktop virtualization technology. I have it installed on my machine and I’m constantly using it to try out new distributions and learn new technologies. It really is a great tool! I have seen it grow from a new project into the fully featured, efficient virtualization competitor that it is today.

I was recently sent a copy of the newly released “VirtualBox 3.1 Beginner’s Guide“, which outlines deploying and managing a cost-effective virtual environment using VirtualBox. I want to thank Packt Publishing for sharing a copy with me, and I’d like to share my review of the book here. I hope some of you will take the time to check out the Packt Publishing website as a resource for technical books.

VirtualBox 3.1 Beginners Guide

The first thing I have to say about this book is that it is very detail oriented.  It truly is a beginners guide. I’m positive I could give this book to my father and he’d be able to install, configure and run VirtualBox on Windows or Linux. It outlines, in step-by-step detail, everything you’d like to know about VirtualBox. Even though I consider myself a Virtualbox veteran, I followed along with some of the tutorials and was impressed that no detail was left out.

One of the things that really stands out about this title is that it includes a huge number of screenshots. The number of screenshots in the book provide any beginner with the visual roadmap they need to complete the task at hand. It covers installing VirtualBox on both a Windows and Ubuntu host, as well as installing and configuring the reverse as guests. If you’ve never installed VirtualBox before, you’ll have an installation up and running in just a few minutes.

Beyond installation and configuration, this book goes into detail regarding the command line options (I learned quite a bit from this chapter!) as well. VirtualBox provides a full set of command line tools for starting, stopping, configuring, cloning and creating virtual machines. This makes it a perfectly reasonable candidate for a headless server virtualization solution!

This book covers guest additions, disk and image creation and management, all networking options and how they differ, using and creating virtual appliances, using snapshots and even remote management. It really is a good resource for getting started with Virtualization. I’m glad to have a copy of this book in my collection.

The sections that were the most useful for me were the networking and command line chapters. I was not familiar with any of the command line tools, and the networking was a little blurry for me. Before getting a copy of this book I was unfamiliar with virtualized networking beyond NAT and Bridged. This book went into enough networking detail that I’m very comfortable with each of the networking options and in what situations each might apply. This will really boost my efficiency and productivity with VirtualBox.

For anyone wanting to learn more about virtualization or doing research into cost-effective virtual environment solutions, I would highly recommend VirtualBox 3.1 Beginner’s Guide.

VirtualBox 3.1 Beginners Guide : Sample Chapter

June 18th, 2010 No comments

I’ve written quite a bit on this blog regarding Virtualization in the past. I think I’ve covered VirtualBox as well as VMware. If you haven’t noticed, I prefer the former. Free Software vs non-free is a big win, plus the performance gain that I’ve seen in VirtualBox has been great. For testing other distributions and doing simple work (non-server) installations, I think VirtualBox works the best.

I was recently sent a copy of “VirtualBox 3.1 Beginners Guide: Deploy and manage a cost-effective virtual environment using VirtualBox” by Packt Publishing. I’ll have a full review out soon, but I wanted to share this sample chapter that they have published as a .pdf.

The sample chapter is a 42 page chapter outlining getting started with VirtualBox. This includes installation, configuration and even outlines the installation of a simple Linux distribution as a guest, DSL (Damn Small Linux). For a “sample” it is actually quite impressive, and goes into a great amount of detail.

I’ll have a full review of the book here soon, but in the meantime have a look at the sample chapter and let me know what you think.

Categories: virtualization Tags: ,

Install VirtualBox on Ubuntu 9.10 “Karmic Koala”

January 15th, 2010 8 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 27 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 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.

KVM and Virt-Manager On Ubuntu 8.04

June 8th, 2008 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 Do Seamless Window and Folder Integration with Ubuntu & VirtualBox

February 1st, 2008 41 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: , ,

Installing Guest Additions For Ubuntu Guests in VirtualBox

October 13th, 2007 110 comments

UPDATE: This post has been updated for more current releases. Please see the new Install VirtualBox Guest Additions article.

As promised in my previous post on installing VirtualBox Open Source Edititon today I’ll be going over installing the Guest Addition tools for better integration between host and guest. These steps have not been tested on other Linux distributions but I’m sure they’ll work about the same way. I tested these on Kubuntu 7.04 running atop Kubuntu 7.10 beta as the host.

Installing Linux Guest Additions in VirtualBox

VirtualBox has made it pretty easy to install the Guest Additions for improved integration between guest and host. Some of these benefits are mouse-capture improvements and improved video resolution. The mouse capture improvements now allow you to control your virtual machine when the mouse is over the window, and seamlessly return to your host when it is not. Improved video resolution should allow you to customize a better resolution for your guests.

What we need to do to install the Guest Additions is select the option from the VirtualBox menu. You’ll want to do this after your guest is running (the guest-additions are installed to the guest, not the host). Select:

Devices > Install Guest Additions...

This sometimes takes a minute so don’t worry if you don’t see anything right away. This should then prompt you and say something along the lines of:

The Guest Additions image is not found on your host. Would you like to download this image now?

We’ll select YES and let it download the image. The image is downloaded to the host machine and then mounted within the guest. This way it can be shared with future guests without needing to download multiple times. It should also prompt you whether or not you’d like to mount the image. Again, select YES.

At this point you should see a disk image mounted on your desktop. What we’ll do here is run a script that will generate the proper modules to allow for guest additions. In my preferred method we’ll do this:

  1. Open a terminal by pressing ALT-F2 and enter “gnome-terminal” on gnome or “konsole” on KDE.
  2. cd /media/cdrom
  3. sudo bash ./VBoxLinux*

This will grind away at generating the proper modules and then prompt you to restart your guest machine. Once this has finished and you’ve rebooted your guest operating system you should have the guest improvements ready to go. No additional configuration for the mouse integration should be needed, but you may have to manually update to a better resolution as wanted.

Hopefully I’ll have the tutorial for building proper network bridging soon as well. Until then, enjoy your virtualization with VirtualBox!

Categories: virtualization Tags: ,