blob: 1ac01cc782ad43d48eb820d31b40395ca613f847 [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
k.kazak1bae7be2019-07-30 14:04:37 +02006======================
seshukmf5e2b0b2018-08-30 18:48:23 +08007
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
k.kazak1bae7be2019-07-30 14:04:37 +020016
seshukmf5e2b0b2018-08-30 18:48:23 +080017*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.
18
19Create a new VM in VirtualBox for Ubuntu
20----------------------------------------
21Type: Linux
22
23Version: Ubuntu (64-bit)
24
25At least 2048 MB memory
26
27At least 40 GB VDI
28
29Network: Attached to: NAT
30
31Create a port-forwarding rule for SSH
32-------------------------------------
33Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
34
35Go to "Network" settings in VirtualBox, add a port forwarding rule:
36
37Name: SSH
38
39Protocol: TCP
40
41Host IP: 127.0.0.1
42
43Host Port: 1022
44
45Guest IP: <leave blank>
46
47Guest Port: 22
48
49.. image:: ../images/Configure_ubuntu_SO_1.png
50
51.
52
53.. image:: ../images/Configure_ubuntu_SO_2.png
54
55Create Shared Folder
56--------------------
57This 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.
58
59Go to "Shared Folders" settings in VirtualBox, add a share:
60
61Folder Path: C:\Users
62
63Folder Name: Users
64
65Auto-mount: <checked>
66
67Read-only: <unchecked>
68
69.. image:: ../images/Configure_ubuntu_SO_3.png
70
71.
72
73.. image:: ../images/Configure_ubuntu_SO_4.png
74
75Install Ubuntu in the VM
76------------------------
k.kazak1bae7be2019-07-30 14:04:37 +020077On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".
seshukmf5e2b0b2018-08-30 18:48:23 +080078
k.kazak1bae7be2019-07-30 14:04:37 +020079Select your Ubuntu ISO image:
80
81.. image:: ../images/Configure_ubuntu_SO_5.png
seshukmf5e2b0b2018-08-30 18:48:23 +080082
83After selecting the ISO image, start the VM.
84
85Follow the prompts to install Ubuntu.
86
87Proxy Configuration (optional)
88------------------------------
k.kazak1bae7be2019-07-30 14:04:37 +020089If you're behind a corporate firewall, configure some proxy settings.
90NOTE: your proxy configuration may require username and password credentials, not shown here.
seshukmf5e2b0b2018-08-30 18:48:23 +080091**Ubuntu system proxy setting:**
92
93 System Settings → Network → Network proxy
94
95 (Replace "proxyhost" and port with your actual proxy information)
96
k.kazak1bae7be2019-07-30 14:04:37 +020097.. image:: ../images/Configure_ubuntu_SO_6.png
seshukmf5e2b0b2018-08-30 18:48:23 +080098
99**apt proxy setting:**
100 Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):
101
102 Acquire::http::Proxy "http://proxyhost:port";
103
104 Reboot the VM.
105
106Install SSH Server
107------------------
108
109.. code-block:: bash
110
111 sudo apt update
112 sudo apt install openssh-server
113
114Connect to the VM from your host computer
115-----------------------------------------
116 The PuTTY SSH client is popular. A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.
117
118.. image:: ../images/Configure_ubuntu_SO_7.png
119
120Install VirtualBox Guest Additions
121----------------------------------
122On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your VirtualBox Guest Additions ISO image.
123
k.kazak1bae7be2019-07-30 14:04:37 +0200124.. image:: ../images/Configure_ubuntu_SO_8.png
seshukmf5e2b0b2018-08-30 18:48:23 +0800125
126In a VM terminal window, mount the cdrom:
127
128.. code-block:: bash
129
130 sudo mkdir -p /media/cdrom
131 sudo mount /dev/cdrom /media/cdrom
132
133Install necessary dependencies:
134
135.. code-block:: bash
136
137 sudo apt update
138 sudo apt install gcc g++ dkms
139
140Install 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.
141
k.kazak1bae7be2019-07-30 14:04:37 +0200142 .. code-block:: bash
seshukmf5e2b0b2018-08-30 18:48:23 +0800143
144 cd /media/cdrom
145 sudo ./VBoxLinuxAdditions.run
146
147.. image:: ../images/Configure_ubuntu_SO_9.png
148
149Add yourself to the vboxsf user group (replace "userid" with your user ID):
150
151.. code-block:: bash
152
153 sudo usermod -a -G vboxsf userid
154
155Reboot the VM.
156
157In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:
158 /media/sf_Users
159
160Further Reading
161----------------------------------------
162
163.. toctree::
164 :maxdepth: 1
165
166 Install_Docker.rst
167 Configure_git_and_gerrit.rst
k.kazak1bae7be2019-07-30 14:04:37 +0200168 Workspace_and_Development_Tools.rst