Main Page‎ > ‎

debian in virtualbox under macos

Get the right sources for apt

cat /etc/apt/sources.list
deb stretch main non-free contrib
deb-src stretch main non-free contrib
deb stretch/updates main non-free contrib
deb-src stretch/updates main non-free contrib

Get keyboard mapping right
I use a french keyboard on my macbook air and I can "|{}" through normal alt key but with the right alt and not the left one: 

# /etc/default/keyboard

Get cut and paste between macos and guest debian working

In virtualbox application:
  • setting->input->virtual machine->host key set it to right cmd
  • device->shared clipboard->bidirectional
  • device->install guest OS tools
apt-get install build-essential linux-headers-amd64
cd /media/cdrom
sh ./

ssh from host/guest to guest/host

You can use bridge mode but also in NAT mode you can do the following enabling a new network interface on guest to talk to vboxnet0 interface on macos host:
  • check that vboxnet0 is enabled: VirtualBox->Settings->Network->Add (you will get vboxnet0), on macos you should see now vboxnet0 interface via ifconfig command
  • on VM's Settings->System->check "Enable I/O APIC." and on VM's Settings->Network->Adapter 2->host-only vboxnet0
  • on debian guest define the new network interface after installing the openssh server:
vi /etc/network/interfaces
auto enp0s8
iface enp0s8 inet static
  • enable the interface via sudo ifup eth1 you can now ssh the guest from host ssh user@ or host from guest

Share directories between host and guest

Go in VM settings and add permanent directories shared, they will appear in /media/sf_dirshared, to allow access to it do under the guest:

addgroup user vboxfs

Recompile kernel modules after apt upgrade

apt update
apt upgrade
/etc/init.d/vboxadd setup

Program to install

localectl set-locale LANG=fr_FR.UTF-8
timedatectl set-timezone Europe/Paris
hostnamectl set-hostname $MYHOSTNAME

hostname $MYHOSTNAME
vi /etc/hostname
vi /etc/hosts localhost mark32

apt install sudo screen mutt irssi vim subversion-tools rsync mosh less unrar tig git openssh-server build-essential python python-setuptools python-pip  convmv sqlite urlview w3m par metastore curl most ispell ifrench mtp-tools apg terminator xpdf mupdf metastore dnsutils retext zim epubcheck calibre openbox obconf meld rxvt-unicode apt-file wmctrl locate nmap catdoc wv elinks links lynx vim-gtk tidy libwmf-bin gv ttm pmount mpc ncmpc epstool gnupg pinentry-tty pinentry-curses
setkbmap fr
apt install locales
locale-gen en_US en_US.UTF-8 en_US.ISO-8859-1 en_US.ISO-8859-15 fr_FR fr_FR.UTF-8 fr_FR.ISO-8859-15 fr_FR.ISO-8859-1
dpkg-reconfigure locales
Generating locales (this might take a while)...
  en_US.ISO-8859-1... done
  en_US.ISO-8859-15... done
  en_US.UTF-8... done
  fr_FR.UTF-8... done
  fr_FR.UTF-8... done
  fr_FR.ISO-8859-15@euro... done
update-locale LANG="fr_FR.UTF-8" LANGUAGE="fr:en"