---
# System prepended metadata

title: Installing Ubuntu Desktop in Virtual Box
tags: [Unix, ubuntu]

---

###### tags: `ubuntu` `Unix`

# Installing Ubuntu Desktop in Virtual Box

## Install Ubuntu Desktop in VirtualBox
Reference [Install Ubuntu Linux on VirtualBox in Windows 7](https://youtu.be/CkDd6jClqEE)

**Backed up D drive before installation**

**Create Virtual Machine**
New > Create Virtual Machine : Machine folder= `D:\OracleVirtualBox`, Memory size= 4096 MB, Storage on physical hard disk= fixed size, File location=D:\OracleVirtualBox\Ubuntu_Linux\Ubuntu_Linux.vdi

Settings > Storage > Add optical drive > Add > D:\My Software\ubuntu-18.04.4-desktop-amd64.iso This drive is mounted to the virtual machine. It's used like a DVD/CD rom device in the virtual computer

Settings > System > processor > increase processor to 2 CPU & check 'enable PAE/NX'

Settings > System > Acceleration > all checked

Settings > Display > screen > maximise video memory to 128 MB (if you can afford this) & check Enable 3D Acceleration

**Install Ubuntu Desktop**
Start > Install Ubuntu > installation type: select 'erase disk and install ubuntu' (because you are installing the OS in a virtual machine, this will not erase the disk and will not delete all the files there.) > language > time zone > add username 'chang', computers name='chang-VirtualBox' ,passowrd, checked 'log in automatically' This prevents repeated screen lock and log in > installing system until installation is completed > Restart now when installation is completed

**Add a Windows shared folder (Method 1)** 
VirtualBox Settings > Shared Folder > D:\bioinformatics, checked auto-mount. This created 3 folders
/media/bioinformatics
/media/chang
/media/sf_bioinformatics

Close Ubuntu and VirtualBox, ensuring these changes will become effective

In terminal, run the following command [Virtualbox shared folder permissions](https://stackoverflow.com/questions/26740113/virtualbox-shared-folder-permissions)
```bash!
sudo adduser $USER vboxsf
```

Restart Ubuntu> Now access the shared folder under
```bash!
ls /media/sf_bioinformatics
```

**Add a Windows shared folder (Method 2) [How to Share Folder Between Windows to Ubuntu - Step by Step Guide](https://www.youtube.com/watch?v=lI-HwfRZqqs)**

1. Change properties of the Windows folder bioinformatics
Right Click on it > Properties > Sharing > Advance Sharing > Check option "share this folder" > permission > remove Group or Username "Everyone" > Add user > select your user account from the list (here chang) > Check Full Control, Read, Change > Apply > Ok > exit

2. open cmd.exe and type
```bash!
ipconfig
```

3. Use Use IPv4 Address under Wireless LAN adapter wireless network connection as Windows IP address if you are using wifi; otherwise, use the IP address under ethernet adapter Local Area Connection if you are using LAN (cable)
e.g. When using UQ wifi, IPv4 Address=10.89.101.122
e.g. When using home wifi, IPv4 Address= 192.168.0.167

4. Check if you have installed cifs-utils
```bash!
apt-cache search cifs
```

5. install cifs-utils if you have not installed cifs-utils
```bash!
sudo apt-get install cifs-utils
```

6. Check if you have any mounted folders
```bash!
df -h
```

7. Create a new folder in Utuntu terminal which will reflect the mounted Windows folder
```bash!
mkdir /media/bioinformatics
```

8. Mount a Windows folder to Ubuntu
```bash!
mount.cifs -o username=chang //192.168.0.167/bioinformatics /media/bioinformatics
```
9. Access the Windows shared folder mounted to Ubuntu
```bash!
ls /media/bioinformatics
```

---

## Enable bi-directional copy and paste (not working)
```bash!
pkill 'VBoxClient --clipboard' -f & sleep 1 && VBoxClient --clipboard
```

Settings > General > Advanced: Shared Clipboard= bidirectional, Drag and drop=  bidirectional

---

## Install Portable Batch System (PBS)

https://github.com/PBSPro/pbspro/blob/master/INSTALL

```bash!
# Find out which version of Debian your Ubuntu is
cat /etc/debian_version
# buster/sid

#For Debian systems you should run the following command as root:
sudo apt-get install gcc make libtool libhwloc-dev libx11-dev libxt-dev libedit-dev libical-dev ncurses-dev perl postgresql-server-dev-all postgresql-contrib python3-dev tcl-dev tk-dev swig libexpat-dev libssl-dev libxext-dev libxft-dev autoconf automake

# Install the prerequisite packages for running PBS Pro. In addition to the commands below, you should also install a text editor of your choosing (vim, emacs, gedit, etc.)
# For Debian (buster) systems you should run the following command as root:
sudo apt-get install expat libedit2 postgresql python3 postgresql-contrib sendmail-bin sudo tcl tk libical3

# Download [PBS Pro v19.1.3](https://github.com/PBSPro/pbspro/releases) into the Downloads folder

# Open a terminal as a normal (non-root) user, unpack the PBS Pro tarball, and cd to the package directory.
cd Downloads

tar -xpvf pbspro-19.1.3.tar.gz

cd pbspro-19.1.3

# Generate the configure script and Makefiles. (See note 1 below)
./autogen.sh

# Display the available build parameters.
./configure --help

# Configure the build for your environment. You may utilize the parameters displayed in the previous step. (See note 2 below). For CentOS and Debian systems you should run the following command:
./configure --prefix=/opt/pbs

# Build PBS Pro by running "make". (See note 4 below)
make

# Configure sudo to allow your user account to run commands as root. Refer to the online manual pages for sudo, sudoers, and visudo.

# 9. Install PBS Pro. Use sudo to run the command as root.
sudo make install

[sudo] password for chang: 
Making install in buildutils
make[1]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/buildutils'
make[2]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/buildutils'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/buildutils'
make[1]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/buildutils'
Making install in src
make[1]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src'
Making install in include
make[2]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/include'
make[3]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/include'
make[3]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/opt/pbs/include'
 /usr/bin/install -c -m 644 pbs_error.h pbs_ifl.h rm.h tm_.h tm.h '/opt/pbs/include'
make[3]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/include'
make[2]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/include'
Making install in lib
make[2]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib'
Making install in Libattr
make[3]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libattr'
make[4]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libattr'
 /bin/mkdir -p '/opt/pbs/lib'
 /usr/bin/install -c -m 644  libattr.a '/opt/pbs/lib'
 ( cd '/opt/pbs/lib' && ranlib libattr.a )
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libattr'
make[3]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libattr'
Making install in Libdb
make[3]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libdb'
make[4]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libdb'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libdb'
make[3]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libdb'
Making install in Liblog
make[3]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Liblog'
make[4]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Liblog'
 /bin/mkdir -p '/opt/pbs/lib'
 /usr/bin/install -c -m 644  liblog.a '/opt/pbs/lib'
 ( cd '/opt/pbs/lib' && ranlib liblog.a )
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Liblog'
make[3]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Liblog'
Making install in Libnet
make[3]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libnet'
make[4]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libnet'
 /bin/mkdir -p '/opt/pbs/lib'
 /usr/bin/install -c -m 644  libnet.a '/opt/pbs/lib'
 ( cd '/opt/pbs/lib' && ranlib libnet.a )
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libnet'
make[3]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libnet'
Making install in Libpbs
make[3]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libpbs'
make[4]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libpbs'
 /bin/mkdir -p '/opt/pbs/lib'
 /bin/bash ../../../libtool   --mode=install /usr/bin/install -c   libpbs.la '/opt/pbs/lib'
libtool: install: /usr/bin/install -c .libs/libpbs.so.0.0.0 /opt/pbs/lib/libpbs.so.0.0.0
libtool: install: (cd /opt/pbs/lib && { ln -s -f libpbs.so.0.0.0 libpbs.so.0 || { rm -f libpbs.so.0 && ln -s libpbs.so.0.0.0 libpbs.so.0; }; })
libtool: install: (cd /opt/pbs/lib && { ln -s -f libpbs.so.0.0.0 libpbs.so || { rm -f libpbs.so && ln -s libpbs.so.0.0.0 libpbs.so; }; })
libtool: install: /usr/bin/install -c .libs/libpbs.lai /opt/pbs/lib/libpbs.la
libtool: install: /usr/bin/install -c .libs/libpbs.a /opt/pbs/lib/libpbs.a
libtool: install: chmod 644 /opt/pbs/lib/libpbs.a
libtool: install: ranlib /opt/pbs/lib/libpbs.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /opt/pbs/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /opt/pbs/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/opt/pbs/lib/pkgconfig'
 /usr/bin/install -c -m 644 pbs.pc '/opt/pbs/lib/pkgconfig'
make[4]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libpbs'
make[3]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libpbs'
Making install in Libpython
make[3]: Entering directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libpython'
gcc -DHAVE_CONFIG_H -I. -I../../../src/include  -I../../../src/include -I/usr/include/python2.7 -I/usr/include/python2.7   -g -O2 -MT libpbspython_a-common_python_utils.o -MD -MP -MF .deps/libpbspython_a-common_python_utils.Tpo -c -o libpbspython_a-common_python_utils.o `test -f 'common_python_utils.c' || echo './'`common_python_utils.c
In file included from common_python_utils.c:40:0:
../../../src/include/pbs_python_private.h:64:10: fatal error: Python.h: No such file or directory
 #include <Python.h>
          ^~~~~~~~~~
compilation terminated.
Makefile:567: recipe for target 'libpbspython_a-common_python_utils.o' failed
make[3]: *** [libpbspython_a-common_python_utils.o] Error 1
make[3]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib/Libpython'
Makefile:504: recipe for target 'install-recursive' failed
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src/lib'
Makefile:506: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/chang/Downloads/pbspro-19.1.3/src'
Makefile:542: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

# Configure PBS Pro by executing the post-install script.
#sudo /opt/pbs/libexec/pbs_postinstall

Cannot find this script in version 19
```

---
