Setting New PHP Development with Apricity OS & VirtualBox : Part 2 – Install and Configure Ubuntu Server 14.04 LTS Guest

In last section I already write about setting VirtualBox for initial preparation. This time I’ll continue with Ubuntu Server 14.04 LTS install.

In this section nothing new beside next and next. One thing I need to use in install the server is only use OpenSSH server when server prompt available package during install.

For Part 1, click here.

Configuration Ubuntu Server 14.04 LTS

To continue with configuration step I prefer to do it from terminal. Open terminal from Apricity OS and type :

ssh ubuntu@localhost -p 2222

note : ubuntu is username that I use for my installation and server 123456.

Port 2222 is port that I use for port forwarding.

Like this one.

ssh ubuntu@localhost -p 2222

ubuntu@localhost’s password:
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 4.2.0-27-generic i686)

* Documentation:  https://help.ubuntu.com/

System information as of Wed Apr 20 12:47:20 WIB 2016

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

Last login: Wed Apr 20 12:09:47 2016 from 10.0.2.2

Update Ubuntu

sudo apt-get update

sudo apt-get upgrade

Configure Ip address for second lan card

In previous post I set host-only network and this card need an address. To edit the address :

sudo nano /etc/network/interfaces

fill with these :

auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0

save.

Restart networking

sudo /etc/init.d/networking restart

Check ip address on this server

ifconfig

eth0      Link encap:Ethernet  HWaddr 08:00:27:e2:40:d5
inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fee2:40d5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:2855 errors:0 dropped:0 overruns:0 frame:0
TX packets:2115 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2769071 (2.7 MB)  TX bytes:206259 (206.2 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:46:fa:a4
inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe46:faa4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4260 (4.2 KB)  TX bytes:648 (648.0 B)

lo        Link encap:Local Loopback
inet addr:127.0.0.1  Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING  MTU:65536  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Yes, IP address properly confgured.

Apricity OS VirtualBox Guest Additions

I got this error :

vbox_iso

When I try to insert guest additions CD image.

Solution :

sudo pacman -S virtualbox-guest-iso

Install VirtualBox Guest Addition on Ubuntu 14.04 LTS

Open VirtualBox on host then click :

Devices -> Insert Guest Additions CD Image

Now, login to Ubuntu server via terminal and type these command :

sudo apt-get install build-essential module-assistant linux-headers-`uname -r` dkms

sudo m-a prepare

sudo mount /dev/cdrom /media/cdrom
cd /media/cdrom
sudo ./VBoxLinuxAdditions.run
sudo reboot

Check for VirtualBox service

Type it :

lsmod | grep vboxguest

Or

ps ax | grep VBox

385 ?        S<     0:00 [iprt-VBoxWQueue]
979 ?        Sl     0:00 /usr/sbin/VBoxService

Great.

Share folder on Host (Apricity OS) to Guest (Ubuntu Server)

On Host

Shared Folders -> click on +

(point to existing folder, in my case I have public_html folder).

Selection_001

On Guest

sudo usermod -a -G vboxsf ubuntu
sudo usermod -a -G vboxsf www-data

shutdown guest.

sudo init 0

Check for Shared Folder

Start Ubuntu server virtual machine and login via ssh using terminal.

ls -l /media/

total 8
drwxr-xr-x 2 root root   4096 Apr 19 22:30 cdrom
drwxrwx— 1 root vboxsf 4096 Apr 18 23:52 sf_public_html

Nice. public_html folder automatically mount and exist on guest (Ubuntu Server).

At this stage Ubuntu server ready for next step. Install all PHP stuff in multiple version.

Note :

I got empty shared folder on the first run. The solution is reinstall guest addition and dkms.

Reference :

How to Install VirtualBox Guest Editions in Ubuntu Server 14.04