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

kernelmkusbpersistencevirtualbox

I have a live persistent USB for Ubuntu 16.04 that I created using mkusb and it gives me exactly what I was wanting: a portable ubuntu that I can use across more than one laptop.

I am not able to get VirtualBox to work after multiple unsuccessful attempts. Upon installing I get a message saying

vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to
find out why.

There were problems setting up VirtualBox. To re-start the set-up
process, run /sbin/vboxconfig as root.

Running dmesg gives a long wall of text. I can pull out any parts of it if that would help.

I run

sudo /sbin/vboxconfig

and get

vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Building
VirtualBox kernel modules. vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules. vboxdrv.sh: failed:
modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox. To re-start the set-up
process, run /sbin/vboxconfig as root.

When I run virtualbox I get this message:

WARNING: The vboxdrv kernel module is not loaded. Either there is no
module
available for the current kernel (4.13.0-36-generic) or it failed to
load. Please recompile the kernel module and install it by

       sudo /sbin/vboxconfig

     You will not be able to start VMs until this problem is fixed.

I notice that my /boot folder has a broken link for vmlinuz

I found my way to this issue: VirtualBox + Secure Boot + Ubuntu = Fail. Its summary is:

The problem is the requirement that all kernel modules must be signed
by a key trusted by the UEFI system, otherwise loading will fail.

Create a personal public/private RSA key pair which will be used to
sign kernel modules.

Use the MOK (“Machine Owner Key”) utility to import the public key so
that it can be trusted by the system.

Reboot the machine. When the bootloader starts, the MOK manager EFI
utility should automatically start.

Edited to add: Boot issues, shim, and vmlinuz are all new to me (in case my use of these terms makes it sound like I know what I'm talking about!).

I followed the steps given there and ran into the same problem described in this issue: Mok Manager Utility Never Loads on Reboot. The solution there was to change the boot order so that the boot that relies on shim is first. It seems that solution is intended for installed ubuntu.

I have neither the /boot/efi/EFI folder, nor the efi files for which the solution asks. Also, I think my boot process for launching the Live Persistent USB (described below) would never see the shim.

To boot, I power down the laptop. I press a special button that powers on the laptop and launches a menu that gives these options:

1) Start normally (which would launch Windows 10),
2) Bios Setup,
3) Boot menu,
4) Recovery.

I select Boot menu. That lets me choose between Windows, Installed Ubuntu (if it's a laptop that has Ubuntu installed on it), and the USB. I choose USB, and then choose Live Persistent USB from the menu I then get.

I notice that the OP there has currentboot at top of boot order. My currentboot is 3rd in the boot order and I bypass the boot order as described above. While I have shim in the Ubuntu that is installed on that laptop, my process would never see it.

I am going to continue to play with it. I thought I would also reach out here. Has anyone successfully installed VirtualBox on a live persistent USB? Or do you have any suggestions for what to check and try?

Best Answer

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

Related Question