Skip to main content

Virtualization and containers

Docker

Running Docker without sudo needs membership in the docker group — otherwise permission denied ... /var/run/docker.sock:

sudo groupadd docker
sudo usermod -aG docker ${USER}
# log out and back in for the group to take effect

Everyday commands:

docker image ls
docker rmi IMAGE_ID

docker ps -a # all containers, including stopped
docker stop CONTAINER_ID
docker rm CONTAINER_ID

docker run -it ubuntu:20.04 bash
cat /etc/*release # identify the image's distro from inside

Adding your user to the docker group is equivalent to giving it root, since a container can mount the host filesystem — grant it deliberately.

QEMU / KVM

Releasing the captured mouse and keyboard:

  • SDL front end: Left Ctrl + Left Alt (the left keys specifically).
  • GTK front end (default since QEMU 1.5): Ctrl + Alt + G.

VMware guest tools

# Server
sudo apt install open-vm-tools

# Desktop
sudo apt install open-vm-tools-desktop open-vm-tools

# Verify the modules are loaded
lsmod | grep vmw

open-vm-tools enables clipboard sharing, drag-and-drop and proper display resizing between host and guest.

Wine

Run Windows applications on Linux.

sudo apt install winetricks
winetricks # GUI to install common Windows runtimes and apps