Stripping down Ubuntu Desktop for a virtual machine
I often run Ubuntu Linux in virtual machines using VirtualBox. I use the Ubuntu Desktop ISO so I can get various niceties. However, the image contains a lot of packages that I don't need and before installing the guest additions the icons in Ubuntu dock (or whatever) take up the whole screen. The scrollbars are invisible unless you hover over them. I'm running in a VM--scrolling is important to me. I also want the VM virtual hard disk to be smaller so I can pass it around more easily. My solution is to copy and paste some terminal commands that make the VM more usuable without going overboard. Specifically, the script:
- Removes Libreoffice, the Amazon shopping thing, Gnome games, and Thunderbird
- Installs things I need like gcc and git
- Installs the VirtualBox guest additions from apt
- Makes the scrollbars always visible (like they used to be)
The script:
# remove libreoffice
echo Y | sudo apt-get remove libreoffice-*
# ***install things commonly used by Forrest*** (do you want these?)
echo Y | sudo apt-get install gcc g++ curl wget vim git gdb
# more removals
echo Y | sudo apt-get remove thunderbird
echo Y | sudo apt-get remove unity-lens-shopping
echo Y | sudo apt-get remove unity-webapps-common
echo Y | sudo apt-get purge gnome-games-common
echo Y | sudo apt-get autoremove
echo Y | sudo apt-get install virtualbox-guest-dkms
# make scrollbars always visible
gsettings set com.canonical.desktop.interface scrollbar-mode normal
Other solutions commonly tell you to start with the Ubuntu Server ISO and install ubuntu-desktop
or other specific packages. However, the script above has the advantage that it runs pretty quickly and doesn't have to download much beyond what you want it to install. If you have suggestions/improvements please let me know forrest at domain dot com.
Last update: Dec 1, 2015