Trying to Set up VirtualBox with Live Persistent USB made using Mkusb

Solution 1:

I made a Persistent USB using mkusb and installed VBox from the repositories, sudo apt install virtualbox-qt.

I rebooted both the virtual machine and the USB several times each with different combinations of OS.

Everything seems to work fine to me, screen shots attached.

I am wondering if the problem could be due to corrupt ISO(s), (check MD5SUM), or the version of VBox.

The version of VBox from the repositories seems smoother than the version from the VirtualBox.org website.

I don't think problems with BIOS/UEFI come into play with virtual machines.

I have also had problems with outdated versions of VBox stop working and requiring updating.

It almost seems a waist running VBox on Ubuntu to make a Virtual thumbdrive, Puppy Linux installs VBox automatically and only takes up about 200MB vs Ubuntu's 1.6GB.

QEMU with Virtual Manager also works well on Persistent flash drive. I think it is faster than VBox, It runs kernel level, whatever that means.

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo apt-get install virt-manager

enter image description here

enter image description here

Solution 2:

There may be problems to run VirtualBox in persistent live Ubuntu

The installation of VirtualBox involves compiling some parts of it into the linux kernel. This works well in installed systems.

A persistent live system is booted with the original kernel, and the overlay system, that takes care of the persistence is doing its job later. For this reason I suspect that it can be difficult to make VirtualBox work well in a persistent live system. Maybe it is possible with some other tool for virtualization, but I have no previous experience of it.

If there are problems with secure boot, I suggest that you turn it off.

Lubuntu host and Lubuntu guest

I tested with a Lubuntu 16.04.1 LTS 64-bit host and a Lubuntu 16.04.1 LTS 32-bit guest (because Lubuntu is lighter than standard Ubuntu).

sudo apt update
sudo apt install virtualbox

It worked directly after installation, but I had problems with the graphic rendering after reboot. Maybe it can be made stable with some setting and for example some guest additions or similar.

Click on the screenshot and view it in a big enough window to see it at full size.

enter image description here

After reboot I had problems when starting from a terminal window with the command

virtualbox

but after reboot, there is a menu entry, and when I started VirtualBox that way, the graphic rendering of the Lubuntu desktop worked. But trying once more failed, so the graphics rendering is flaky.

Anyway, the installation worked without issues, and the overall result was better than I expected.

Lubuntu host and Xubuntu guest

The graphics of the virtualized system seems to work better with a Xubuntu 64-bit guest (than with a Lubuntu 32-bit guest). So I think that the previous problem was not caused by running VirtualBox in a persistent live system.

enter image description here

The virtual machine might be slow

Be prepared that the virtual machine might be slow, if the USB drive is slow. See this link,

Notes about speed

You can run VirtualBox in Ubuntu installed in a fast USB3 drive

There is an alternative that I am using: An installed system in a fast USB3 drive with [Windows 10 in] VirtualBox. The light-weight alternative is a fast USB3 pendrive, and a more powerful alternative is a USB3 SSD (either a USB3 SSD box or a standard SATA SSD in a USB SATA to USB3 or eSATA box).

Such a system is portable between computers, but not as portable as a persistent live system. If your computers work without proprietary drivers (for graphics and wifi) or work with the same proprietary drivers, they will probably work with an installed Ubuntu system in a USB drive.

There are detailed instructions at the following link,

Boot Ubuntu from external drive

Edit 1 to answer your comment:

When testing VirtualBox in a persistent live Ubuntu based system

  • some version may work better. I tried 16.04.1 LTS created from the Lubuntu desktop iso file lubuntu-16.04.1-desktop-amd64.iso

  • I installed virtualbox from the repositories with

    sudo apt update
    sudo apt install virtualbox
    
  • I selected a suitable 'internal environment' in VirtualBox to match the guest operating system, that I wanted to run,

    • 'General -- Basic -- Version: Ubuntu (64-bit)

    • enough RAM (2 GB in a computer with 4 GB)

    • connected the virtual optical drive to an iso file

    • created a virtual disk

    • and installed Xubuntu from xubuntu-16.04.1-desktop-amd64.iso

This screenshot shows the installed Xubuntu system in VirtualBox. Click on the screenshot and and view it in a big enough window to see it at full size.

enter image description here

Edit 2, summary about hosts and guests:

I tested also an Artful dot one host, Lubuntu 17.10.1 (64-bit) and it can handle guest versions 16.04.1, 17.10 and also Bionic (to be released soon as 18.04 LTS).

Running VirtualBox in Lubuntu 16.04.1 LTS and 17.10.1, I found that the boot option nomodeset makes Virtualbox render the graphics correctly for Lubuntu 17.10.1 and Bionic guests, but the resolution will be limited to 1024x768 (and lower).

Standard Ubuntu and other Ubuntu flavours as guest operating systems work well.

See details at this link to the Ubuntu Forums.