Installing Debian Stretch in a VirtualBox VM is pretty straight forward, but there are a few things to do to get the basic comforts of home.

  1. Download a Debian image.

  2. Use VirtualBox to create a new VM, and mount the Debian image as a CD.

  3. Follow the GUI and install.

  4. Start the VM, the rest of the commands are setting up the OS with what’s needed.

  5. Install and setup sudo.

    su -
    apt-get install -y sudo
    usermod -aG sudo <your-username>
    
  6. Restart the VM.

  7. Prepare for installing VirtualBox Guest Additions.

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install build-essential module-assistant
    sudo m-a prepare
    
  8. In VirtualBox select Devices > Insert Guest Additions CD image....

  9. Install VirtualBox Guest Additions.

    sudo sh /media/cdrom/VBoxLinuxAdditions.run
    
  10. Restart the VM.

You’ll now have a VM running Debian Stretch, with some of the basics setup.