0

I would like to run a desktop Ubuntu VM on top of (desktop or server) Ubuntu host; all the while looking like it is running on the bare metal. The reason for this is I would like to relegate critical processes to the host machine; where I can not disrupt their operation (I could, but I would have to specifically log in to the host system to do that; and most of the time I will be working in the VM instead) and where they won't be troubled by such things as system restarts.

I'd like to use KVM virtualization, as that's what I'm familiar on the server.

I think I'll need VGA passthrough for near-native performance? Can I do that on a laptop with just an integrated Intel graphics card?

I prefer command-line solutions that can be automated.

2 Answers2

0

You are looking for Linux Containers:

Containers are a lightweight virtualization technology. They are more akin to an enhanced chroot than to full virtualization like Qemu or VMware, both because they do not emulate hardware and because containers share the same operating system as the host. Therefore containers are better compared to Solaris zones or BSD jails.

LXC is very lightweight, so it's most common application is to have a container for each service. This means you can save up on a lot of space and other resources, since nothing is allocated unless needed. However, that doesn't mean it's the only way to use it. For example, Docker is a service built on LXC, for packaging and deploying complete apps.

LXc can be used for running GUI apps, or even X itself. This Unix & Linux answer has a guide. Essentially:

  1. Install any requisite drivers on both host and container systems.
  2. Make the device nodes available to the container, creating them via mknod if necessary.
  3. Configure them (the OP did it manually, since udev isn't available in the container).
  4. Start X on an unused VT.

However, in your case, where you want things to Just Work and don't mind using the VM for everything X, you can use KVM with libvirt. Check the official Server Guide.

muru
  • 207,228
-1

The VM's are intended to appear as bare metal machines. You shouldn't notice any difference except for the restrictions that you actually place on your VM.

You might consider running your VM and posting questions of how to resolve any issue you might encounter. Most likely there will be a resolution to provide specifically what you might need, such as more video memory, lower level access to the hardware, etc.

To boot full screen:

  1. While in your VM OS, of virtual box, select the full screen option.
  2. Right click on the Virtual box profile of your preferred OS and click "Create Desktop Launcher".
  3. Grab the exec command from the created launch and make a batch file such indicated below
  4. Add the created created batch file your Ubuntu startup applications.
  5. Configure (from Ubuntu's user's manager) to boot the Ubuntu with the Automatic Login activated.

Batch file for Startup Applications (mystartvm.sh):

#!/bin/bash                                                                     

sleep 20                                                                        
/usr/lib/virtualbox/VirtualBox --startvm "ec9329a2-d86a-45ba-9dbe-cdd0d8e5c74b"

You can fine tune any step for your preference. I added the 20 seconds to give my machine time to perform the other background tasks that I have setup at boot time.

Of course there are many ways of doing this. This is just one of many.

The Guest OS appears to be on a bare machine. Of course as some pointed out, it really isn't on a bare machine. But the operator (as in making this easy for my clients) can't tell the difference. The OS is ran as if it were on a bare machine and not a guest.

L. D. James
  • 25,444