Troubleshooting the Virtual Machine Setup
Slow VM
Symptom: Your Ubuntu virtual machine is too slow. The desktop environment lags when opening or moving windows.
Solution: Switch to Lubuntu. To make this switch, you do not need to reinstall from scratch. Instead, just use apt to download the Lubuntu desktop:
$ sudo apt install lubuntu-desktop
During installation, you will are prompted to select a "desktop manager". Keeping the default (gdm3) is fine.
After rebooting, the splash screen looks the same as before. But after clicking your name to enter your login password, there is a gear icon in the bottom right. That icon lets you select Lubuntu as your desktop environment at login.
Slow VM in VirtualBox on a Mac (with Retina Display)
Symptom: VM window is small, and/or performance is slow, and/or key press causes repeated characters.
Solution: Run VirtualBox in "low resolution" mode. See here.
No 64-bit Option for VM Creation
Symptom: When creating a new virtual machine in VirtualBox, the only Ubuntu option is 32-bit. There is no 64-bit option in the drop-down menu for "Name and Operating System".
Solution: Enable virtualization extensions in the BIOS settings of your host machine. Depending on the kind of processor you have, this means enabling either VT-x or AMD-v (for Intel or AMD respectively).
PAE Error on Boot
Symptom: During first boot-up of virtual machine, the following error machine appears: "This kernel requires the following features not present on the CPU: pae. Unable to boot - please use a kernel appropriate for your CPU"
Solution: Select the virtual machine in Virtual Box's manager window, then click "Settings" and under System > Processor, check "Enable PAE/NX".
Virtual Box Guest Additions Won't Install
Symptom: Installing Virtual Box "guest additions" fails with the error message: "This system is currently not set up to build kernel modules. Please install the gcc make perl packages from your distribution."
Solution: Install the missing packages with:
$ sudo apt install dkms
Note: While dkms is not used directly, this install will get the needed packages. See this Virtual Box wiki page.
Desktop Won't Resize
Symptom: Your virtual machine desktop doesn't resize when you change the size of the window.
Solution: Reinstall Virtual Box "guest additions" (Devices > Insert Guest Additions CD image…). Although you did this when setting up the virtual machine, updates to your distribution will sometimes break the guest additions. After running the guest additions CD, you will need to log out of your account on the VM.
Gtk Warnings
Symptom: When launching a window (e.g., emacs) you see warnings like: "Gtk-WARNING **: Unable to locate theme engine in module_path: pixmap"
Solution:
$ sudo apt install gtk2-engines-pixbuf
Error Running Rails
Symptom: Running "rails server" does NOT start the Puma server. Instead you get a help message about how to run rails:
Usage:
rails new APP_PATH [options]
Solution: Make sure you are running "rails server" from the application directory.
$ cd demo
$ rails server
VM Hard Disk is Full
Symptom: Error message such as "no space on left on device" or "disk is full". This happens when your initial allocation was too small for all the applications and files you ended up having on your virtual machine.
Solution: First increase the size of the virtual hard disk using VirtualBox's management tool (File > Virtual Media Manager…), then use Gparted to repartition the virtual hard disk so the OS "sees" the larger disk. The steps are a bit complicated, but there are very good instructions here.