blob: e06385e39b76390769e7a9dfb5a3c26a2b038e42 [file] [log] [blame]
seshukm613e4482017-10-11 10:17:45 +05301.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2017 Huawei Technologies Co., Ltd.
4
seshukm15941432017-11-08 12:48:13 +05305SO Install & Configure
Seshu-Kumar-Mbf2b9e12017-10-11 16:33:41 +08006==========================================
seshukm613e4482017-10-11 10:17:45 +05307
8Get Ubuntu
9----------
10Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.
11
12Get VirtualBox and VirtualBox Guest Additions
13---------------------------------------------
14Make sure you have the VirtualBox Guest Additions ISO for your version of VirtualBox. I'm using VirtualBox 5.1.28. Save the Guest Additions ISO on your host computer along with the Ubuntu ISO. Get the Guest Additions ISO from here:
seshukmeb818452018-05-23 16:06:56 +053015 http://download.virtualbox.org/virtualbox
seshukm613e4482017-10-11 10:17:45 +053016*NOTE*: Guest Additions versions prior to 5.1 will not work with Ubuntu 16.04.3. If you have an earlier version of VirtualBox, you should upgrade to the latest 5.1 version.
17
18Create a new VM in VirtualBox for Ubuntu
19----------------------------------------
20Type: Linux
seshukmbf355422017-11-06 09:14:42 +053021
seshukm613e4482017-10-11 10:17:45 +053022Version: Ubuntu (64-bit)
seshukmbf355422017-11-06 09:14:42 +053023
seshukm613e4482017-10-11 10:17:45 +053024At least 2048 MB memory
seshukmbf355422017-11-06 09:14:42 +053025
seshukm613e4482017-10-11 10:17:45 +053026At least 40 GB VDI
seshukmbf355422017-11-06 09:14:42 +053027
seshukm613e4482017-10-11 10:17:45 +053028Network: Attached to: NAT
29
30Create a port-forwarding rule for SSH
31-------------------------------------
32Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
seshukmbf355422017-11-06 09:14:42 +053033
seshukm613e4482017-10-11 10:17:45 +053034Go to "Network" settings in VirtualBox, add a port forwarding rule:
seshukmbf355422017-11-06 09:14:42 +053035
seshukm613e4482017-10-11 10:17:45 +053036Name: SSH
seshukmbf355422017-11-06 09:14:42 +053037
seshukm613e4482017-10-11 10:17:45 +053038Protocol: TCP
seshukmbf355422017-11-06 09:14:42 +053039
seshukm613e4482017-10-11 10:17:45 +053040Host IP: 127.0.0.1
seshukmbf355422017-11-06 09:14:42 +053041
seshukm613e4482017-10-11 10:17:45 +053042Host Port: 1022
seshukmbf355422017-11-06 09:14:42 +053043
seshukm613e4482017-10-11 10:17:45 +053044Guest IP: <leave blank>
seshukmbf355422017-11-06 09:14:42 +053045
seshukm613e4482017-10-11 10:17:45 +053046Guest Port: 22
47
seshukmcb4f8702018-08-21 20:49:19 +080048.. image:: ../images/Configure_ubuntu_SO_1.png
seshukmbf355422017-11-06 09:14:42 +053049
50.
51
seshukmcb4f8702018-08-21 20:49:19 +080052.. image:: ../images/Configure_ubuntu_SO_2.png
seshukmbf355422017-11-06 09:14:42 +053053
seshukm613e4482017-10-11 10:17:45 +053054Create Shared Folder
55--------------------
56This is oriented to Windows users. If you're using a MAC or a Linux host computer, the details may be different. You can share any folder on the host computer with the Ubuntu VM. On Windows, a practical choice is to share the C:\Users folder, so that your Windows home directory will be accessible from the Ubuntu VM.
seshukmbf355422017-11-06 09:14:42 +053057
seshukm613e4482017-10-11 10:17:45 +053058Go to "Shared Folders" settings in VirtualBox, add a share:
seshukmbf355422017-11-06 09:14:42 +053059
seshukm613e4482017-10-11 10:17:45 +053060Folder Path: C:\Users
seshukmbf355422017-11-06 09:14:42 +053061
seshukm613e4482017-10-11 10:17:45 +053062Folder Name: Users
seshukmbf355422017-11-06 09:14:42 +053063
seshukm613e4482017-10-11 10:17:45 +053064Auto-mount: <checked>
seshukmbf355422017-11-06 09:14:42 +053065
seshukm613e4482017-10-11 10:17:45 +053066Read-only: <unchecked>
67
seshukmec1cf232018-08-22 15:49:51 +080068.. image:: ../images/Configure_ubuntu_SO_3.png
seshukmbf355422017-11-06 09:14:42 +053069
70.
71
seshukmec1cf232018-08-22 15:49:51 +080072.. image:: ../images/Configure_ubuntu_SO_4.png
seshukmbf355422017-11-06 09:14:42 +053073
seshukm613e4482017-10-11 10:17:45 +053074Install Ubuntu in the VM
75------------------------
76On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your Ubuntu ISO image.
77
seshukmbf355422017-11-06 09:14:42 +053078.. image:: images/Configure_ubuntu_SO_5.png
79
seshukm613e4482017-10-11 10:17:45 +053080After selecting the ISO image, start the VM.
seshukmbf355422017-11-06 09:14:42 +053081
seshukm613e4482017-10-11 10:17:45 +053082Follow the prompts to install Ubuntu.
83
84Proxy Configuration (optional)
85------------------------------
86If you're behind a corporate firewall, configure some proxy settings. NOTE: your proxy configuration may require username and password credentials, not shown here.
87**Ubuntu system proxy setting:**
seshukmbf355422017-11-06 09:14:42 +053088
seshukm613e4482017-10-11 10:17:45 +053089 System Settings → Network → Network proxy
seshukmbf355422017-11-06 09:14:42 +053090
seshukm613e4482017-10-11 10:17:45 +053091 (Replace "proxyhost" and port with your actual proxy information)
92
seshukmbf355422017-11-06 09:14:42 +053093.. image:: images/Configure_ubuntu_SO_6.png
94
seshukm613e4482017-10-11 10:17:45 +053095**apt proxy setting:**
96 Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
seshukmbf355422017-11-06 09:14:42 +053097
seshukm613e4482017-10-11 10:17:45 +053098 Acquire::http::Proxy "http://proxyhost:port";
seshukmbf355422017-11-06 09:14:42 +053099
seshukm613e4482017-10-11 10:17:45 +0530100 Reboot the VM.
101
102Install SSH Server
103------------------
seshukmbf355422017-11-06 09:14:42 +0530104
105.. code-block:: bash
106
107 sudo apt update
108 sudo apt install openssh-server
seshukm613e4482017-10-11 10:17:45 +0530109
110Connect to the VM from your host computer
111-----------------------------------------
112 The PuTTY SSH client is popular. A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
113
seshukmec1cf232018-08-22 15:49:51 +0800114.. image:: ../images/Configure_ubuntu_SO_7.png
seshukmbf355422017-11-06 09:14:42 +0530115
seshukm613e4482017-10-11 10:17:45 +0530116Install VirtualBox Guest Additions
117----------------------------------
118On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your VirtualBox Guest Additions ISO image.
119
seshukmbf355422017-11-06 09:14:42 +0530120.. image:: images/Configure_ubuntu_SO_8.png
121
seshukm613e4482017-10-11 10:17:45 +0530122In a VM terminal window, mount the cdrom:
seshukmbf355422017-11-06 09:14:42 +0530123
124.. code-block:: bash
125
seshukm613e4482017-10-11 10:17:45 +0530126 sudo mkdir -p /media/cdrom
127 sudo mount /dev/cdrom /media/cdrom
seshukmbf355422017-11-06 09:14:42 +0530128
seshukm613e4482017-10-11 10:17:45 +0530129Install necessary dependencies:
seshukmbf355422017-11-06 09:14:42 +0530130
131.. code-block:: bash
132
133 sudo apt update
134 sudo apt install gcc g++ dkms
135
seshukm613e4482017-10-11 10:17:45 +0530136Install the guest additions. NOTE: look for errors in the command output! If you see an error that says you are missing kernel headers, the most likely cause is that you are using a VirtualBox version that is too old. The error message is misleading.
seshukmbf355422017-11-06 09:14:42 +0530137
138.. code-block:: bash
139
seshukm613e4482017-10-11 10:17:45 +0530140 cd /media/cdrom
141 sudo ./VBoxLinuxAdditions.run
142
seshukmcb4f8702018-08-21 20:49:19 +0800143.. image:: ../images/Configure_ubuntu_SO_9.png
seshukmbf355422017-11-06 09:14:42 +0530144
seshukm613e4482017-10-11 10:17:45 +0530145Add yourself to the vboxsf user group (replace "userid" with your user ID):
seshukmbf355422017-11-06 09:14:42 +0530146
147.. code-block:: bash
148
seshukm613e4482017-10-11 10:17:45 +0530149 sudo usermod -a -G vboxsf userid
seshukmbf355422017-11-06 09:14:42 +0530150
seshukm613e4482017-10-11 10:17:45 +0530151Reboot the VM.
seshukmbf355422017-11-06 09:14:42 +0530152
seshukm613e4482017-10-11 10:17:45 +0530153In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:
154 /media/sf_Users
155
156Further Reading
157----------------------------------------
seshukmbf355422017-11-06 09:14:42 +0530158
159.. toctree::
160 :maxdepth: 1
161
seshukmec1cf232018-08-22 15:49:51 +0800162 installconfigure/Install_Docker.rst
163 installconfigure/Configure_git_and_gerrit.rst
164 installconfigure/Workspace_and_Development_Tools.rst