Boot guest system into virtual graphics driver instead of nvidia

Hey mates!

I have an installation with an nvidia GPU (proprietary), which I want to boot as a guest system via virtualization.

The booting itself works fine, I can access TTY, but I don’t get graphical environment.

Upon booting, the driver itself tells me, that there is no nvidia GPU found and lightdm/startx fails, as there are no screens connected.

It seems as this system still wants to boot into the nvidia driver.

Is there any possibility to have it boot into the virtual gpu driver instead?

As I also use this installation as-is (and then as a host system), I still want to be able to boot into nvidia driver. So just deinstalling nvidia drivers won’t be the solution.

I’d like to either have a switch (read: make the system ready to boot into nvidia or VM the next time) or maybe there is some kernel parameter I can set or if I can startx with another config file that doesn’t rely on nvidia.

I also found out these lines in my /etc/mkinitcpio.conf:


Does this mean nvidia is being loaded nonetheless?

Please show me a way on how to boot into the virtual gpu driver without removing nvidia drivers. I’d be very glad!

If you need any further information, pls don’t hesitate to ask!

Just to add, this is the output if I simply try to startx:


You should read PCI passthrough via OVMF - ArchWiki and related examples.

But with that I would lose access on GPU on my host system (Windows).

What I’d try to achieve is:

  • Run Windows as host for gaming (Battlefield 2042)
  • open VirtualBox and have my “main Linux” as a guest

And when I’m done with gaming, I want to reboot into my beloved Linux (then again with nvidia) and not hear anything from that Windows thing. :slight_smile:

So I’m looking for a way to normally boot host Linux with nvidia, but also boot Linux as guest with standard virtual graphics.

Try using nomodeset added to Grub boot parameter and drop the early KMS from /etc/mkinitcpio.conf, aka remove the nvidia related modules line …

I can test that tonight I guess.

What does removing the Modules line imply?

I guess:

  1. running sudo mkinitcpio -P before rebooting
  2. not able to boot into nvidia until I add them back again?

Ok, unfortunately this didnt work :C

I only left MODULES=() and I removed the nvidia-line out of the FILES(...) section.

Then I did sudo mkinitcpio -P and sudo update-grub.

I definitely got another output upon booting (for example not looking for nvidia), but still no X11 could run. It said it refused connection.

Unfortunately, I got some bad reads on the filesystem (cryptfs said some damages file and tried to repair it on boot), so now I’m very cautious.

I do not see you confirming that you used nomodeset … but then, if you used UEFI to install the native system and the VM is legacy, then you can expect inconsistencies, plus the VM (that you said is virtualbox) will need the virtualbox-guest-modules.

Oh of course I tested with the nomodeset kernel parameter. :slight_smile:

Yes, it’s UEFI-installed, but it’s also set as UEFI in the VirtualBox.

Can you confirm you mean virtualbox-guest-modules? I have virtualbox-guest-utils installed, but can’t find modules in the repositories.