0

I have set up a combined dual boot/Virtualbox system with Windows 8 as my main OS and a Ubuntu 14.04 LTS hard drive which can also be accessed as a virtual machine by VirtualBox using this guide.

Even though I am not a very experienced Linux-, let alone Ubuntu-user, I managed to get it up and running except for one problem:

I would like to use the proprietary fglrx drivers for my ATI Radeon R9 285x when I actually boot into Ubuntu because I expect better performance, and even more for the most trivial reason that the fan of my VGA is running much louder when using the open source driver. But when I choose them, I am no longer able to access my Ubuntu desktop via VirtualBox and get stuck in Login-loop, most likely because it can't load the proper drivers.

On the other hand, I also installed guest additions, which provide me with all the convenience of a full-resolution seamless virtual machine. But when I activate them, they replace the graphics driver also for regular booting of Ubuntu.

So right now I can choose between either a virtual machine with full graphic support but a genuine Ubuntu environment with a loud graphic fan and incomplete graphic support, or a virtual machine with no graphic support at all but a fully functional Ubuntu system. Switching requires re- or deinstalling fglrx each time.

So my question is:

Is it possible to let the system switch between the fglrx driver and the Virtualbox-guest-addition-driver, depending on whether it is booted regularly or in a virtual machine?

0

I have managed to succeed in my efforts to get this undoubtedly exotic setup to work as I want it too.

After a reinstall of Ubuntu, the problems with installed guest additions for the natively booted system disappeared.

The only remaining problem was being unable to login into the virtual machine desktop with fglrx drivers installed. Although the kernel modules always adopted correctly to the corresponding environment (vbox modules only running inside the virtual machine and fglrx module only running when booted natively) there seemed to be something still preventing the start of the desktop environment inside the virtual machine.

This turned out to be the AMD libglx libraries, which were still in use for the virtual machine.

Fortunately, the fglrx driver software provides an easy switch command from amd to intel, so all that needed to be done was executing

sudo /usr/lib/fglrx/switchlibglx intel

and restart lightdm.

To have this executed automatically during boot, I created a file named "checkvga.conf" in /etc/init/ reading

# Checks if VGA belongs to virtual machine

description      "Checks if VGA belongs to virtual machine"


start on starting lightdm


script
    if test -f /proc/modules &&  grep -q vboxguest /proc/modules 2>/dev/null; then
    /usr/lib/fglrx/switchlibglx intel
    restart lightdm
    fi
end script

I had to put in the "restart lightdm" command to get it to work reliable, although I originally had assumed that "start on starting lightdm" would have been enough to have this command executed before lightdm was launched the first time. The reason might be that actually, X is required to be restarted, since there might have already been an instance of it to display the splash screen during boot. If someone knows, please enlighten me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.