Merge "Add initial groovy file for activate"
[so.git] / docs / Install_Configure_SO.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
2 .. http://creativecommons.org/licenses/by/4.0\r
3 .. Copyright 2017 Huawei Technologies Co., Ltd.\r
4 \r
5 SO Install & Configure\r
6 ==========================================\r
7 \r
8 Get Ubuntu\r
9 ----------\r
10 Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.\r
11 \r
12 Get VirtualBox and VirtualBox Guest Additions\r
13 ---------------------------------------------\r
14 Make 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:\r
15     http://download.virtualbox.org/virtualbox\r
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.\r
17 \r
18 Create a new VM in VirtualBox for Ubuntu\r
19 ----------------------------------------\r
20 Type: Linux\r
21 \r
22 Version: Ubuntu (64-bit)\r
23 \r
24 At least 2048 MB memory\r
25 \r
26 At least 40 GB VDI\r
27 \r
28 Network: Attached to: NAT\r
29 \r
30 Create a port-forwarding rule for SSH\r
31 -------------------------------------\r
32 Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.\r
33 \r
34 Go to "Network" settings in VirtualBox, add a port forwarding rule:\r
35 \r
36 Name: SSH\r
37 \r
38 Protocol: TCP\r
39 \r
40 Host IP: 127.0.0.1\r
41 \r
42 Host Port: 1022\r
43 \r
44 Guest IP: <leave blank>\r
45 \r
46 Guest Port: 22\r
47 \r
48 .. image:: images/Configure_ubuntu_SO_1.png\r
49 \r
50 .\r
51 \r
52 .. image:: images/Configure_ubuntu_SO_2.png\r
53 \r
54 Create Shared Folder\r
55 --------------------\r
56 This 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.\r
57 \r
58 Go to "Shared Folders" settings in VirtualBox, add a share:\r
59 \r
60 Folder Path: C:\Users\r
61 \r
62 Folder Name: Users\r
63 \r
64 Auto-mount: <checked>\r
65 \r
66 Read-only: <unchecked>\r
67 \r
68 .. image:: images/Configure_ubuntu_SO_3.png\r
69 \r
70 .\r
71 \r
72 .. image:: images/Configure_ubuntu_SO_4.png\r
73 \r
74 Install Ubuntu in the VM\r
75 ------------------------\r
76 On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your Ubuntu ISO image.\r
77 \r
78 .. image:: images/Configure_ubuntu_SO_5.png\r
79 \r
80 After selecting the ISO image, start the VM.\r
81 \r
82 Follow the prompts to install Ubuntu.\r
83 \r
84 Proxy Configuration (optional)\r
85 ------------------------------\r
86 If you're behind a corporate firewall, configure some proxy settings.  NOTE: your proxy configuration may require username and password credentials, not shown here.\r
87 **Ubuntu system proxy setting:**\r
88 \r
89         System Settings → Network → Network proxy\r
90         \r
91         (Replace "proxyhost" and port with your actual proxy information)\r
92 \r
93 .. image:: images/Configure_ubuntu_SO_6.png\r
94         \r
95 **apt proxy setting:**\r
96         Edit /etc/apt/apt.conf and add one line at the top (replace "proxyhost:port" with your actual proxy information):\r
97         \r
98                 Acquire::http::Proxy "http://proxyhost:port";\r
99                 \r
100         Reboot the VM.\r
101         \r
102 Install SSH Server\r
103 ------------------\r
104 \r
105 .. code-block:: bash\r
106 \r
107     sudo apt update\r
108     sudo apt install openssh-server\r
109 \r
110 Connect to the VM from your host computer\r
111 -----------------------------------------\r
112         The PuTTY SSH client is popular.  A connection to localhost:1022 (or whatever port you have forwarded) will go to the VM.\r
113 \r
114 .. image:: images/Configure_ubuntu_SO_7.png\r
115         \r
116 Install VirtualBox Guest Additions\r
117 ----------------------------------\r
118 On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image".  Select your VirtualBox Guest Additions ISO image.\r
119 \r
120 .. image:: images/Configure_ubuntu_SO_8.png\r
121 \r
122 In a VM terminal window, mount the cdrom:\r
123 \r
124 .. code-block:: bash\r
125 \r
126         sudo mkdir -p /media/cdrom\r
127         sudo mount /dev/cdrom /media/cdrom\r
128         \r
129 Install necessary dependencies:\r
130 \r
131 .. code-block:: bash\r
132 \r
133     sudo apt update\r
134     sudo apt install gcc g++ dkms\r
135         \r
136 Install 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.\r
137 \r
138 .. code-block:: bash\r
139 \r
140         cd /media/cdrom\r
141         sudo ./VBoxLinuxAdditions.run\r
142 \r
143 .. image:: images/Configure_ubuntu_SO_9.png     \r
144         \r
145 Add yourself to the vboxsf user group (replace "userid" with your user ID):\r
146         \r
147 .. code-block:: bash    \r
148         \r
149         sudo usermod -a -G vboxsf userid\r
150         \r
151 Reboot the VM.\r
152 \r
153 In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:\r
154         /media/sf_Users\r
155         \r
156 Further Reading\r
157 ----------------------------------------        \r
158 \r
159 .. toctree::\r
160    :maxdepth: 1\r
161 \r
162    Install_Docker.rst\r
163    Configure_git_and_gerrit.rst\r
164    Workspace_and_Development_Tools.rst