UB: Ubuntu 18.04 LTS Desktop VM Setup

VirtualBox Setup

  • Ubuntu 18.04 LTS Desktop
  • ISO: ubuntu-18.04-desktop-amd64.iso
  • OS: Linux_x64
  • Memory: 2G
  • Video: 128M
  • USB:3.0
  • HDD: 10G

Install net-tools

sudo apt install net-tools

Install OpenSSH server


sudo apt install openssh-server

sudo apt install openssh-client

Install firewall config tools

sudo apt install firewalld

gcc install


Required for VBox Guest Additions

sudo apt install gcc

sudo apt install gcc-7

sudo apt install gcc-8

sudo apt install build-essential

sudo apt install make

sudo apt install perl

VirtualBox Guest Additions

Requires [gcc make perl]

Shutter ScreenCap

sudo apt-get install shutter

Create keyboard shortcuts

  • PrtScn
    • shutter -f
  • C-PrtScn
    • shutter -s
  • A-PrtScn
    • shutter –active / -a

JDK8 Installation

Check/Create JVM path


Pull JDK8

wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz"


tar -xvzf jdk-8u171-linux-x64.tar.gz -C /usr/lib/jvm

Create Alternatives links

update-alternatives --install <link> <name> <path> <priority>

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_171/bin/java 1


update-alternatives --list java



update-alternatives --config java

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/jdk1.8.0_171/bin/java

Nothing to configure.


update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.8.0_171/bin/jar 1

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_171/bin/javac 1

Setup Environment Variables

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_171

printenv JAVA_HOME

export PATH=$PATH:/usr/lib/jvm/jdk1.8.0_171/jre/bin

printenv PATH


Download Eclipse


Extract to /usr/local/ & create symbolic link for easier system-wide access

tar -xvzf eclipse-jee-oxygen-3a-linux-gtk-x86_64.tar.gz -C /usr/local/

ln -s /usr/local/eclipse/eclipse /usr/bin/eclipse

sudo chmod 777 /usr/bin/eclipse

Create Desktop launcher

# nano /usr/share/applications/eclipse.desktop


Comment=Eclipse IDE

Eclipse: Subclipse 4.2.4

Eclipse was freezing on SVN repo due to missing JavaHL dependencies ( even when attempting to use Team > SVNKit )


sudo apt install libsvn-java
sudo find / -name libsvnjavahl-1.so

Add library to eclipse.ini



Remote Desktop

xRDP Installation



sudo apt-get install xrdp -y

netstat -antup | grep xrdp

netstat -ntlp | grep 3389

Enable xrdp at startup

etc/init.d/xrdp start


Configure Firewall

firewall-cmd --permanent --add-port=3389/tcp

firewall-cmd --reload


NPP under Wine







If the file you are trying to create or edit does not require root privilege, run this:

wine /home/jon/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe

If it does require root permission at all, install the notepad++ with your root account after having been logged in as root (e.g. by executing sudo -s -H), log out, and run:

sudo wine /home/root/.wine/drive_c/Program\ Files/Notepad++/notepad++.exe

But usually, as has been pointed out, running wine applications as root is not recommended since wine apps rely on wine and the source code of wine apps may or may not be reviewed, meaning there is an increased amount of risk involved in doing so.


Install Notes


UB: Ubuntu 18.04 C++ gcc build-essentials



gcc-7 and gcc-8 will happily co-live together.

I would suggest to let gcc-7 be installed, for satisfying build-essential and perhaps other dependent packages, and configure gcc-8 to be your default gcc installation.

Use update-alternatives for having gcc redirected automatically to gcc-8:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 --slave /usr/bin/g++ g++ /usr/bin/g++-7

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8

This will give you the convenience of gcc being at the latest version, and still you will be able to invoke gcc-7 or gcc-8 directly.

If you'll wish to change the default gcc version later on, run sudo update-alternatives --config gcc. It will bring a prompt similar to this, which lets you pick the version to be used:

There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

Selection Path Priority Status


* 0 /usr/bin/gcc-8 800 auto mode

1 /usr/bin/gcc-7 700 manual mode

2 /usr/bin/gcc-8 800 manual mode


Press <enter> to keep the current choice[*], or type selection number:


The higher priority is the one that is picked automatically by update-alternatives.



update-alternatives --help

Usage: update-alternatives [<option> ...] <command>


--install <link> <name> <path> <priority>

[--slave <link> <name> <path>] ...

add a group of alternatives to the system.

--remove <name> <path> remove <path> from the <name> group alternative.

--remove-all <name> remove <name> group from the alternatives system.

--auto <name> switch the master link <name> to automatic mode.

--display <name> display information about the <name> group.

--query <name> machine parseable version of --display <name>.

--list <name> display all targets of the <name> group.

--get-selections list master alternative names and their status.

--set-selections read alternative status from standard input.

--config <name> show alternatives for the <name> group and ask the

user to select which one to use.

--set <name> <path> set <path> as alternative for <name>.

--all call --config on all alternatives.


<link> is the symlink pointing to /etc/alternatives/<name>.

(e.g. /usr/bin/pager)

<name> is the master name for this link group.

(e.g. pager)

<path> is the location of one of the alternative target files.

(e.g. /usr/bin/less)

<priority> is an integer; options with higher numbers have higher priority in

automatic mode.



--altdir <directory> change the alternatives directory.

--admindir <directory> change the administrative directory.

--log <file> change the log file.

--force allow replacing files with alternative links.

--skip-auto skip prompt for alternatives correctly configured

in automatic mode (relevant for --config only)

--verbose verbose operation, more output.

--quiet quiet operation, minimal output.

--help show this help message.

--version show the version.