HeadlessなDebianをmacOSのVirtualBox上に構築したメモ

  • Debianからインストールイメージをダウンロード
  • インストールイメージを使って、仮想マシンを構築(sshを有効にしておきます)

ホストオンリーアダプターを追加

/etc/network/interfaces にホストオンリーアダプターを追記

allow-hotplug enp0s8
iface enp0s8 inet dhcp

ホストオンリーアダプターに設定された IP Address の確認

$ ip addr show

Installing the Linux Guest Additions

Guest Additions for Linux

# mount /dev/cdrom /media/cdrom
# apt-get install -y dkms build-essential linux-headers-$(uname -r)
# ./VBoxLinuxAdditions.run

ヘッドレス起動

VBoxHeadless, the Remote Desktop Server

$ VBoxManage startvm "VM name" --type headless