Note to self: I had a problem with the GUI on my Kubuntu VM not working under VirtualBox on a Kubutnu host. I fixed the problem by changing the Graphics Controller on the VM from VBoxSVGA to VMSVGA. I have no idea what the difference is, except that the latter works and the former doesn’t!
Tag Archives: virtualbox
VirtualBox reference configuration for Kubuntu 18.04 hosts and Kubuntu 18.04 guests
See my reference configuration for hardware selections which worked well for me when running Kubuntu 18.04 guests on Kubuntu 18.04 hosts.
After configuring your VM you might like to read about installing Kubuntu on it.
Installing Kubuntu
So basically I want to run KDE Plasma under Ubuntu and this can be called Kubuntu.
This article is a little bit cargo-clutish. I.e. “I did this and it seemed to work.” and “I don’t do this because it didn’t seem to work.”
I have a pretty heavy reliance on Salt Stack for system configuration. My salt config is all built around Ubuntu 18.04 LTS.
When I need to install a Kubuntu desktop, this is how I do it:
- install Ubuntu Server 18.04 LTS from live installer
- apt update && apt dist-upgrade && apt autoremove && reboot
- apt install kubuntu-desktop && reboot
- apt install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 && reboot
- apt install salt-minion
- vim /etc/salt/minion_id
- vim /etc/salt/minion.d/minion.conf
- master: salt.staticmagic.net
- service salt-minion restart
- salt-call state.highstate
Note that if your Kubuntu install is a VirtualBox guest you need to start it with a normal start if you want the shared clipboard to work. If you start headless or detachable the shared clipboard will not work (in my experience).
If your Kubuntu install is not a VirtualBox guest you can skip the virtualbox-guest-* package installation above.
Shared clipboard for Ubuntu 18.04 guest in Ubutnu 18.04 host under VirtualBox 6.0
My shared clipboard wasn’t working for my Ubuntu 18.04 guests running on my Ubutnu 18.04 host under VirtualBox 6.0.
To fix first make sure that the shared clipboard is enabled in VirtualBox for the VM. The setting for that is under General -> Advanced -> Shared Clipboard.
Then try running these commands in the guest:
- sudo apt install virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
- sudo reboot
These steps (or something similar) got the shared clipboard working for me. Hooray!
Note that these instructions will vary if you’re running a HWE kernel.
Waiting for VirtualBox guests to close before reboot or shutdown
vim /etc/init.d/virtualbox chmod +x /etc/init.d/virtualbox update-rc.d virtualbox defaults
The /etc/init.d/virtualbox script should look like this:
#!/bin/sh # 2017-08-07 jj5 - SEE: How make Debian wait for all VirtualBox guests to # stop during shutdown/reboot?: https://superuser.com/a/929292/615689 ### BEGIN INIT INFO # Provides: virtualbox_start_and_stop # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: # Description: Start virtualbox on boot, and shutdown safely on shutdown/reboot. ### END INIT INFO case "$1" in start) echo "Starting Virtualbox " # Do whatever to start or resume your virtualbox instances. # Perhaps look for a txt file someplace with VMs that need to be # restarted or resumed... then start 'em. ;; stop) echo "Stopping Virtualbox" # Do something to either shutdown or savestate your virtualbox instances. # maybe also save the instances that should be resumed into a txt file # someplace for the start method above. # 2017-08-07 jj5 - SEE: # https://askubuntu.com/a/457564 # 2017-08-07 jj5 - NOTE: You should make sure that ACPI Shutdown actually # shuts down the guest... # 2017-08-07 jj5 - SEE: Force Ubuntu Desktop to shutdown on power button: # https://www.progclub.org/blog/2017/08/07/force-ubuntu-desktop-to-shutdown-on-power-button-keypress-acpi-shutdown/ while [ -n "$( sudo -u jj5 VBoxManage list runningvms )" ]; do sudo -u jj5 VBoxManage list runningvms \ | sed -r 's/.*\{(.*)\}/\1/' \ | xargs -L1 -I {} sudo -u jj5 VBoxManage controlvm {} acpipowerbutton; sleep 1; done; ;; *) echo "Usage: /etc/init.d/virtualbox {start|stop}" exit 1 ;; esac exit 0
You may also need to Force Ubuntu Desktop to shutdown on power button keypress…
VirtualBox VBoxManage for autostart
I have a script tact:/etc/vbox/register-autostart.sh
which will register a VirtualBox VM for auto-start. It required other config in /etc/vbox
the details of which I don’t remember, but I think it’s done now anyway… there’s more information in Starting virtual machines during system boot.
online "$machine" && { report "halting machine '$machine'..."; ssh "$machine" sudo poweroff; report "waiting a moment..."; sleep 8; }; run VBoxManage modifyvm "$machine" --autostart-enabled on; run sudo service vboxautostart-service restart;
Installing VirtualBox on Debian
Found this article: How to install or upgrade VirtualBox on Ubuntu or Debian…
VirtualBox shared folders
Followed HOWTO: Use Shared Folders…