blob: bdfd328fc5fa8c39c630c3172a5e9e0dc9feccf8 [file] [log] [blame]
seshukmf5e2b0b2018-08-30 18:48:23 +08001.. 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
5SO Install & Configure
6==========================================
7
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:
15 http://download.virtualbox.org/virtualbox
16*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
21
22Version: Ubuntu (64-bit)
23
24At least 2048 MB memory
25
26At least 40 GB VDI
27
28Network: 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.
33
34Go to "Network" settings in VirtualBox, add a port forwarding rule:
35
36Name: SSH
37
38Protocol: TCP
39
40Host IP: 127.0.0.1
41
42Host Port: 1022
43
44Guest IP: <leave blank>
45
46Guest Port: 22
47
48.. image:: ../images/Configure_ubuntu_SO_1.png
49
50.
51
52.. image:: ../images/Configure_ubuntu_SO_2.png
53
54Create 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.
57
58Go to "Shared Folders" settings in VirtualBox, add a share:
59
60Folder Path: C:\Users
61
62Folder Name: Users
63
64Auto-mount: <checked>
65
66Read-only: <unchecked>
67
68.. image:: ../images/Configure_ubuntu_SO_3.png
69
70.
71
72.. image:: ../images/Configure_ubuntu_SO_4.png
73
74Install 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
78.. image:: images/Configure_ubuntu_SO_5.png
79
80After selecting the ISO image, start the VM.
81
82Follow 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:**
88
89 System Settings → Network → Network proxy
90
91 (Replace "proxyhost" and port with your actual proxy information)
92
93.. image:: images/Configure_ubuntu_SO_6.png
94
95**apt proxy setting:**
96 Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
97
98 Acquire::http::Proxy "http://proxyhost:port";
99
100 Reboot the VM.
101
102Install SSH Server
103------------------
104
105.. code-block:: bash
106
107 sudo apt update
108 sudo apt install openssh-server
109
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
114.. image:: ../images/Configure_ubuntu_SO_7.png
115
116Install 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
120.. image:: images/Configure_ubuntu_SO_8.png
121
122In a VM terminal window, mount the cdrom:
123
124.. code-block:: bash
125
126 sudo mkdir -p /media/cdrom
127 sudo mount /dev/cdrom /media/cdrom
128
129Install necessary dependencies:
130
131.. code-block:: bash
132
133 sudo apt update
134 sudo apt install gcc g++ dkms
135
136Install 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.
137
138.. code-block:: bash
139
140 cd /media/cdrom
141 sudo ./VBoxLinuxAdditions.run
142
143.. image:: ../images/Configure_ubuntu_SO_9.png
144
145Add yourself to the vboxsf user group (replace "userid" with your user ID):
146
147.. code-block:: bash
148
149 sudo usermod -a -G vboxsf userid
150
151Reboot the VM.
152
153In 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----------------------------------------
158
159.. toctree::
160 :maxdepth: 1
161
162 Install_Docker.rst
163 Configure_git_and_gerrit.rst
164 Workspace_and_Development_Tools.rst