Ubuntu 18.0.4.2 Set up on VirtualBox - weaponsforge/fastractor GitHub Wiki
Content
- Requirements
- VirtualBox Installation and Set-up
- Create an Ubuntu VM in VirtualBox
- Install Ubuntu OS in the VM
- Post Installation Actions
- Connect a Shared Windows Directory
- Install Development Tools in the Ubuntu VM
Requirements
-
Host Machine - Windows 64-bit OS
NOTE: A machine with the following specs is used for this tutorial.
- Windows 10 Pro
- Processor: Intel(R) Core(TM) i7-6700HQ @ 2.60GHz 2.60GHz
- RAM: 16 GB
- GPU: GeForce GTX 1060
- Dedicated GPU Memory: 6 GB
- GPU Memory: 14 GB
- Shared GPU Memory: 8 GB
-
Oracle Virtual Box
- Version 6.1.14 r140239 (Qt5.6.2
-
Ubuntu OS ISO image
-
Stable internet connection
VirtualBox Installation and Set-up
- Install VirtualBox using the installer.
- When prompted for selections, do not select anything and just choose the default settings.
Create an Ubuntu VM in VirtualBox
- Press the New button (beside the Settings (gears) button.
- Select the following for the Name and operating system options:
- Name - (type any name for your VM)
- Machine Folder: (select your target directory)
- Type: Linux
- Version: Ubuntu (64-bit)
- Press the Next button.
- Set the following:
- Memory Size: 2048 (or higher as needed, 4096)
- Hard Disk File Type: VDI (Virtualization Disk Image)
- Storage on physical hard disk: Dynamically allocated
- File location and size
- Name: enter or select your target directory and filename.
- Virtual hard disk size in MB: 32 GB or adjust according to your needs
- Hard Disk - Create a virtual hard disk now
- Press the Create button.
Install Ubuntu OS in the VM
Launch the Ubuntu OS Installer
- Launch VirtualBox and click your target VM from the left panel list.
- In the right-side panel of the VM you clicked
- Go to Storage -> Controller: IDE Secondary Master
- Click the [Optical Drive] Empty label
- Select Choose a disk file...
- Find and select the Ubuntu ISO image ubuntu-18.04.2-desktop-amd64.iso
- Press the Start (Show) button and wait for the Ubuntu OS installation UI to appear.
Install Ubuntu
The steps below follow from the previous section Launch the Ubuntu OS Installer.
- Select Install Ubuntu.
- Enter your desired username in the "Type here to test your keyboard" on the Keyboard layout screen.
-
IMPORTANT: keyboard strokes won't be detected on the succeeding screens, so be sure to copy your username from the next sub-step.
- highlight the text you've entered. Right + Click and Select
- Press Continue
-
- Select the following options In the Updates and other software screen:
- What apps would you like to install to start with? - Normal installation
- Other options
- Select
Download updates while installing ubuntu
- Select
Install third-party software for graphics and Wi-Fi hardware and additional media formats
- Select
- Press Continue
- Select the following options in the Installation type screen:
- Erase disk and install ubuntu
- Press Install Now
- If a prompt Write the changes to disks appear, press Continue to proceed with the installation.
- Enter your location (or just accept the default value) in the Where are you? screen.
- Press Continue
- Fill in the input fields in the Who are you? screen.
- Paste the username you have typed earlier on Step #2 if keyboard input is not working
- Press Continue
- Wait for the installation to finish.
- Press the Restart Now button when prompted after finishing the installation.
- Ubuntu will load and a message will appear:
Please remove the installation medium, then press ENTER:
- VirtualBox has already removed the Ubuntu installer ISO image at this point. Verify that it is indeed removed on VirtualBox Storage -> Controller: IDE IDE Secondary Master (this should be
[Optical Drive] Empty
- Press Enter
- Wait for Ubuntu to boot.
- View your Linux version.
uname -m && cat /etc/*release
Post Installation Actions
- Login your Ubuntu VM
- Be sure you have internet connection.
- Click the Software Updater icon to check for updates.
- Install the latest Ubuntu updates.
- be sure you have internet connection.
- wait for a few moments until the Software Updater prompt appears.
- Press the Install Now button.
- Look for the Software Updater button. Wait for updates to finish installing.
- Choose to Restart Now when prompted.
- Install the VirtualBox Guest Additions, a set of drivers and system utilities intended to improve usability and VM performance as well as tight integration with a host OS.
- Install the following dependencies if they are not yet already installed:
gcc
make
perl
- quick install command:
- Install the following dependencies if they are not yet already installed:
sudo apt-get update
sudo apt-get install -y gcc make perl
- install gcc 9 (and associated make) [link](https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91)
NOTE: sudo apt autoremove (when prompted)
sudo apt-get update -y &&
sudo apt-get upgrade -y &&
sudo apt-get dist-upgrade -y &&
sudo apt-get install -y build-essential linux-headers-`uname -r`
sudo apt-get install build-essential software-properties-common -y &&
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
sudo apt-get update -y &&
sudo apt-get install gcc-9 g++-9 -y &&
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 &&
sudo update-alternatives --config gcc
- install dependencies for the virtualbox guest addons (if you chose the quick install command):
sudo apt-get update
sudo apt-get install -y build-essential linux-headers-`uname -r`
- On the running Ubuntu VM screen,
- Press Devices
- Select Insert Guest Additions CD Image...
- When the "VBox_GAs_6.1.14" prompt appears, press Run
- When prompted to restart, restart from the command line:
sudo shutdown -r now
- Do not unmount "VBox_GAs_6.1.14" on succeeding sessions. Create a backup of your VM.
Connect a Shared Windows Directory
NOTE: The following steps requires to have the virtualbox guest addons installed. See previous section for more info.
- Boot up the Ubuntu VM carrying from the last section.
- Copy the windows path of your target directory to share, i.e.
D:\DEV\Portal
- Open VirtualBox. Go to Settings -> Shared Folders.
- Press the Add button. Fill up the following input fields:
- Folder Path: D:\DEV\Portal
- Folder Name: (any name i.e., portal)
- Auto-mount: (checked)
- Mount point:
/home/adminuser/portal
(or any other paths)
- Set the shared folder directory permissions (for Ubuntu).
cd ~/
sudo adduser $USER vboxsf
sudo su
cd portal/
sudo shutdown -r now
- Use the following command for Centos 8 instead of sudo adduser $USER vboxsf (from #5):
usermod -a -G vboxsf $USER
- The host folder should now be accessible inside the VM from
/home/adminuser/portal
- Repeat from step #1 - #4 on every VM boot up. We will not make a permanent shared folder mount for optimization purposes.
Install Development Tools in the Ubuntu VM
- Install Git if its not yet installed.
sudo apt install git
git --version
-
Install nvm
- fetch the script and install nvm
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
- restart the terminal and verify the nvm version
nvm --version
- fetch the script and install nvm
-
Install NodeJS using nvm.
- list available nodejs versions
nvm ls-remote
- install target nodejs version
nvm install 12.18.4
- list available nodejs versions
-
Install curl
sudo apt install curl
-
Install cmake
- checkout the latest cmake release version from https://github.com/Kitware/CMake/releases/
wget
the latest cmakewget https://github.com/Kitware/CMake/releases/download/v3.18.3/cmake-3.18.3.tar.gz
- extract the downloaded cmake archive
tar -zxvf cmake-3.18.3.tar.gz
- install cmake
cd cmake-3.18.3
./bootstrap
make
sudo make install
- alternate (shorter) install
./bootstrap && make && sudo make install
References
1(https://gist.github.com/estorgio/0c76e29c0439e683caca694f338d4003) - connect a shared folder to ubuntu in virtualbox