Ubuntu Setup after Installation
Every once in a while I setup a new Ubuntu VM and I have to redo all these steps. This will help me speed things up.
- VM Specifications
- Install Virtualization Plugins
- Set Keyboard Shortcuts
- Install Useful Packages
- Disable Screenlock and Screensaver
- Install Go 1.10
- Edit .bashrc
- Install VS Code
- Install Docker - Optional
VM Specifications
- RAM: 4GB.
- VGA memory: 128MB (max) in VirtualBox and 1GB in VMWare.
- Enable 3D acceleration.
- Disk space: 30 or 40GB.
Install Virtualization Plugins
These allow clipboard copy/paste and sometimes even drag/drop.
VirtualBox
- If the VM does not have a CD-ROM, shut it down, add one and launch.
- Load the guest additions ISO:
Devices > Insert Guest Additions CD Image...
. - Navigate to the mounted drive.
- Run
sudo ./VBoxLinuxAdditions.run
. - Enable:
Devices > Shared Clipboard > Bidirectional
.Devices > Drag and Drop > Bidirectional
.- Dropped files will be in
/tmp/VirtualBox Dropped Files
and the directory is deleted on boot.
- Dropped files will be in
- Restart.
- Profit.
VMWare
sudo open-vm-tools open-vm-tools-desktop
.- Restart.
- Shared clipboard will work, not sure about files.
Set Keyboard Shortcuts
Set at System Settings > Keyboard > Shortcuts
.
Custom Shortcuts > New
- Name:terminal
- Command:gnome-terminal
- Key:Super+R
.Navigation > Hide all normal windows
- change toSuper+D
. Works after logout.
Install Useful Packages
Some packages are not installed by default.
sudo apt-get update
sudo apt-get install curl git libltdl-dev
Disable Screenlock and Screensaver
No reason to have them in a VM.
Settings > Brightness & Lock
:
- Set lock to off.
Turn screen off when inactive for: Never
.
Install Go 1.10
Current golang
package is not up to date.
sudo apt-get update
.sudo apt-get install golang-1.10
.- This will install go in
/usr/lib/go-1.10/
.
- This will install go in
- I don't like the default
GOPATH
(/home/$USER/go
). I prefer files to be on desktop.mkdir -p /home/$USER/Desktop/Go/{src,bin,pkg}
.
Edit .bashrc
Inb4 that's not the correct way to do this.
Set GOROOT
and new GOPATH
to PATH:
export PATH="/usr/lib/go-1.10/bin:/home/$USER/Desktop/Go/bin:$PATH"
.export GOPATH="/home/$USER/Desktop/Go"
.
Navigate to Desktop
in every new terminal (this will cause errors if terminals are opened in other paths):
cd Desktop
.
Apply settings with:
source ~/.bashrc
.
Install VS Code
Electron app, so be sure to download more RAM assign lots of RAM to VM.
Copied from official instructions:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get update
sudo apt-get install code
Install Docker - Optional
Instead of using the docker.io
package through aptitude, use the official instructions at:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88 # This might change in the future
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-compose
# Test
sudo docker run hello-world
If docker-compose
does not work after installation and you get this error message Couldn't connect to Docker daemon at http+unix://var/run/docker.sock
or something similar, add yourself to the docker
group, logout and login:
usermod -aG docker ${USER}