Useful Debian 12 VM Commands

  • Select xterm.js under the Console pull down for copy/paste functions


  • Enable SSH
passwd root
sed -i -e 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' -e 's/^PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
ssh-keygen -A
systemctl restart sshd

  • Resize the Bootdisk (/dev/sda)

Hardware > Hard Disk (scsi0) > Disk Action > Resize


  • Expand VM Disk using parted (/dev/sda1)
apt-get update && apt-get -y upgrade
apt-get install -y parted

parted /dev/sda
resizepart 1
Fix/Ignore? Fix
Partition number? 1
Yes/No? Yes
End? [2146MB]? -0
(parted) quit
(reboot if not going further)

  • Add Guest Agent
apt-get install qemu-guest-agent

  • Change Hostname (replace “docker-vm” with whatever you want)
hostnamectl set-hostname docker-vm
sed -i '2i127.0.1.1       docker-vm' /etc/hosts

  • Install Docker

sh <(curl -sSL

  • Install Docker Compose
LATEST=$(curl -sL | grep '"tag_name":' | cut -d'"' -f4)
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -sSL$LATEST/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
  • Add Dockge

  • Install Docker Compose first

mkdir -p /opt/{dockge,stacks}
wget -q -O /opt/dockge/compose.yaml
cd /opt/dockge
docker compose up -d

Dockge GUI, https:// IP:5001

  • Add Portainer

  • Docker run

docker volume create portainer_data
docker run -d \
  -p 8000:8000 \
  -p 9443:9443 \
  --name=portainer \
  --restart=always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \

Portainer GUI, https:// IP:9443

Feel free to post more useful commands.