-
Download Ubuntu 18.04 image at here
-
Download Oracle VirtualBox package at here
-
Download Oracle VirtualBox Extension Pack at here
-
Install the package
I constructed a local ubuntu mirror server so that I can use
apt install
. If you did not do this, you are supposed to move all of dependencies one by one to offline environment from online environment.sudo dpkg -i virtualbox-6.0_6.0.14-133895_Ubuntu_bionic_amd64.deb sudo apt install --fix-broken
-
Sign kernel modules of VirtualBox
Physical access to the host machine is required to enroll singing key using MOK manager EFI utility. Signing process is at here.
-
Configure VirtualBox
sudo /sbin/vboxconfig sudo reboot
-
Install Oracle VirtualBox Extension Pack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.14.vbox-extpack
-
Create network
There are five modes of network for VirtualBox. I will use NAT Network. You can check other modes in Table 6.1. Overview of Networking Modes. If you want bi-directional communication between host and guest, you have to set the bridge network.
VBoxManage natnetwork add --netname natnet --network "192.168.1.0/24" --enable --dhpc on VBoxManage natnetwork start --netname natnet1
-
Create virtual machine
cd some_where_create_a_virtual_machine VBoxManage createvm --name Ubuntu_1804 --ostype Ubuntu_64 --register --basefolder $(pwd) VBoxManage modifyvm Ubuntu_1804 --memory 16384 --cpus 4 --boot1 dvd --nic1 natnetwork --nat-network1 natnet1 --hwvirtex on --vrde on --vrdeport 5001 VBoxManage storagectl Ubuntu_1804 --name "Ubuntu_1804_SATA" --add sata VBoxManage createhd --filename $(pwd)/Ubuntu_1804/Ubuntu_1804.vdi --size 131072 --format VDI --variant Standard VBoxManage storageattach Ubuntu_1804 --storagectl Ubuntu_1804_SATA --port 1 --type hdd --medium $(pwd)/Ubuntu_1804/Ubuntu_1804.vdi VBoxManage storageattach Ubuntu_1804 --storagectl Ubuntu_1804_SATA --port 0 --type dvddrive --medium /tmp/ubuntu-18.04.3-live-server-amd64.iso VBoxManage startvm Ubuntu_1804 --type headless
-
Connect to the Ubuntu Server using Remote Desktop Protocol (RDP)
-
Ctrl + R (Run) - Enter "mstsc" - Enter "[Host IP Address]:5001"
-
Install Ubuntu Server 18.04
-
-
Notes
-
Control
VBoxManage controlvm VBoxManage controlvm Ubuntu_1804 pause|resume|reset|poweroff|savestate
-
Port Forward
To port-forward to some port between 1-1024 (well-known ports), you may need root permission.
VBoxManage natnetwork modify --netname natnet1 --port-forward-4 "ssh:tcp:[127.0.0.1]:10022:[192.168.1.4]:22" ssh [username]@localhost -p 10022 VBoxManage natnetwork modify --netname natnet1 --port-forward-4 delete ssh
-