site_treelogo
  -   Terms of Use and Privacy
Apps | GNU/Linux | Meta
site_treelogo
  -   Terms of Use and Privacy
Apps | GNU/Linux | Meta

<<   <   >   >>

2019-07-21 | GNU/Linux | Using VirtualBox

While the focus of this site is on Ubuntu 18.04 in a self-contained, non-network way, it is useful to have a networked version of the reference OS that can can communicate locally. This allows configuration and testing of a non-networked system from another system that is connected to the internet. While it is easy to mirror this site, it is also quite likely that you are reading this from the internet. VirtualBox is a free tool, now owned by Oracle, that lets you run the system so that you can connect to it and use it, but the machine itself is not able to connect to the internet. To do this, set up a host-only adapter:

This allows you to log on from the host system via ssh, but still isolates the machine from the internet:

$ ssh usr-1@192.168.56.101
usr-1@192.168.56.101's password: 
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-42-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage


 * Canonical Livepatch is available for installation.
   - Reduce system reboots and improve kernel security. Activate at:
     https://ubuntu.com/livepatch

0 packages can be updated.
0 updates are security updates.


Last login: Sun Jul 21 11:45:05 2019 from 192.168.56.1
usr-1@srv-1:~$ 

Another useful tool to run with an isolated VM for testing purposes is the shared folder. To install this, you need to install the guest additions. After that, share a folder using something like this:

To get this to automount, don't do it in the GUI, do it in fstab. usr-1 is uid 1000, on our machine:

scratc /home/usr-1/scratc vboxsf rw,uid=1000,umask=022 0 0

Configuration files and other items can be placed in the shared folder and referenced via symlinks. As an example, to share a terminator config file, we created this symlink on our host system:

ln -s /Users/divine/.config/terminator/config /Users/divine/scratc/terminatorconfig

On the VM, we used:

ln -s /home/usr-1/scratc/terminatorconfig /home/usr-1/.config/terminator/config

Tags: networking