Results 1 to 5 of 5

Thread: How to install VirtualBox guest additions on new Ubuntu hosts

  1. #1
    Join Date
    Apr 2010
    Beans
    134
    Distro
    Kubuntu

    Lightbulb How to install VirtualBox guest additions on new Ubuntu hosts

    Hello,

    Forgive me if this has already been covered somewhere in the forums, but I had some trouble with this issue for a while and finally found a solution.

    Introduction: I use Virtual Box a lot, to test out new and different Linux distributions. Lately, when hosting the newer version of Ubuntu and its derivatives, I just kept having issues when trying to run the installation for the guest additions.

    Here's how it went, when installing guest additions on an older Ubuntu (or derivative) host.. I run the installation file (usually VBoxLinuxAdditions-x86.run) with root privileges. The installation then runs, I may have to say "yes" to a prompt or two, and it finishes. I reboot the virtual machine, and guest additions work!

    New versions of Ubuntu and its derivatives just don't seem to be that easy. However, I finally realized what does need to be done to make it work, and it's not much more difficult, it's really just a little bit different work flow.

    Issues when installing: When trying to install guest additions on newer Ubuntu hosts, you may receive errors during the installation, the installation doesn't complete, or the screen may reset and give you strange colors and a an extremely low and awkward resolution. This happens if you're presumably using the work flow of simply running the guest additions installation from the desktop.

    The way I got it to work:
    First, boot up your virtual machine with Ubuntu installed on it. This seems strange to me, but you must install VirtualBox on your Ubuntu guest machine. The regular, non-OSE version from the repository should do just fine. Open VirtualBox one time so that it creates a configuration file. Then, just close it.

    Next, run
    Code:
    sudo /etc/init.d/vboxdrv setup
    If you get an error message about DKMS when trying to run the above command, simply install the package DKMS from Synaptic. You can also run
    Code:
    sudo apt-get install dkms
    to install it.

    Once the setup has completed, we're now ready to install the guest additions. In VirtualBox, click Devices>Install guest additions. This mounts a virtual CD-ROM drive to the guest OS, and contains the guest additions drivers on it.

    Now, stop your desktop completely. Typically, the command would be:
    LXDE desktop:
    Code:
    sudo /etc/init.d/lxdm stop
    Gnome Desktop:
    Code:
    sudo /etc/init.d/gdm stop
    KDE Desktop:
    Code:
    sudo /etc/init.d/kdm stop
    This brings you to a command line. Sign in as root, and navigate to the guest additions CD-ROM drive, as a folder should be mounted for it in /media (from when we clicked "Install guest additions" before killing the desktop). Then, try running the guest additions installation. The command should be:

    Code:
    sudo sh VBoxLinuxAdditions-x86.run
    With any luck, it should complete just fine! Then, restart your guest OS completely, and you should be greeted with mouse integration and auto resizing resolution! I still do have trouble with this in LXDE, specifically, Lubuntu.

    Please remember a few things about these instructions, I'm just a simple Linux user, not an expert. So, please don't criticize whatever technical skills this post may be lacking. I'm just trying to give some tips for anyone out there who may be having trouble with the guest additions on newer Ubuntu hosts.

    Hope this helps, and feel free to make corrections to my work flow!

    EDIT: If you're still having trouble installing the drivers by running the VBoxLinuxAdditions-x86.run file, try running:

    Code:
    sudo apt-get install virtualbox-ose-guest-x11
    This worked perfectly for me. You may even be able to just install that package right from the get go. Here is the link to the source where I found that tip: http://lockergnome.net/questions/888...n-ubuntu-10-10
    Last edited by travlemon; March 20th, 2011 at 07:23 AM.

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How to install VirtualBox guest additions on new Ubuntu hosts

    Nice write up.

    One thing, you don't need to login as root, if you are using sudo. Also note that the root account is disabled by default on Ubuntu.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Apr 2010
    Beans
    134
    Distro
    Kubuntu

    Re: How to install VirtualBox guest additions on new Ubuntu hosts

    Quote Originally Posted by CharlesA View Post
    Nice write up.

    One thing, you don't need to login as root, if you are using sudo. Also note that the root account is disabled by default on Ubuntu.
    Thanks! I had some problems in the past with installing them even with sudo. I cheat on my Ubuntu systems and use "sudo passwd" to set a custom password for root. Is that bad?? haha.

  4. #4
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: How to install VirtualBox guest additions on new Ubuntu hosts

    Not bad as long as you know the risks.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  5. #5
    Join Date
    Apr 2010
    Beans
    134
    Distro
    Kubuntu

    Re: How to install VirtualBox guest additions on new Ubuntu hosts

    Quote Originally Posted by CharlesA View Post
    Not bad as long as you know the risks.
    Of course! Anything really risky, I test out in a vbox first! I usually don't tinker too much though

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •