1 .. 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.
6 ==========================================
10 Get the Ubuntu ISO image from ubuntu.com. The recommended version is 16.04.3 LTS (Long Term Support), desktop edition.
12 Get VirtualBox and VirtualBox Guest Additions
13 ---------------------------------------------
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:
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.
18 Create a new VM in VirtualBox for Ubuntu
19 ----------------------------------------
22 Version: Ubuntu (64-bit)
24 At least 2048 MB memory
28 Network: Attached to: NAT
30 Create a port-forwarding rule for SSH
31 -------------------------------------
32 Create a port-forwarding rule so that you can use PuTTY (or other SSH client) to connect to the VM.
34 Go to "Network" settings in VirtualBox, add a port forwarding rule:
44 Guest IP: <leave blank>
48 .. image:: ../images/Configure_ubuntu_SO_1.png
52 .. image:: ../images/Configure_ubuntu_SO_2.png
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.
58 Go to "Shared Folders" settings in VirtualBox, add a share:
66 Read-only: <unchecked>
68 .. image:: ../images/Configure_ubuntu_SO_3.png
72 .. image:: ../images/Configure_ubuntu_SO_4.png
74 Install Ubuntu in the VM
75 ------------------------
76 On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your Ubuntu ISO image.
78 .. image:: images/Configure_ubuntu_SO_5.png
80 After selecting the ISO image, start the VM.
82 Follow the prompts to install Ubuntu.
84 Proxy Configuration (optional)
85 ------------------------------
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.
87 **Ubuntu system proxy setting:**
89 System Settings → Network → Network proxy
91 (Replace "proxyhost" and port with your actual proxy information)
93 .. image:: images/Configure_ubuntu_SO_6.png
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):
98 Acquire::http::Proxy "http://proxyhost:port";
108 sudo apt install openssh-server
110 Connect 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.
114 .. image:: ../images/Configure_ubuntu_SO_7.png
116 Install VirtualBox Guest Additions
117 ----------------------------------
118 On the "Storage" panel in VirtualBox, click on "[ optical drive ]" and then "Choose Disk Image". Select your VirtualBox Guest Additions ISO image.
120 .. image:: images/Configure_ubuntu_SO_8.png
122 In a VM terminal window, mount the cdrom:
126 sudo mkdir -p /media/cdrom
127 sudo mount /dev/cdrom /media/cdrom
129 Install necessary dependencies:
134 sudo apt install gcc g++ dkms
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.
141 sudo ./VBoxLinuxAdditions.run
143 .. image:: ../images/Configure_ubuntu_SO_9.png
145 Add yourself to the vboxsf user group (replace "userid" with your user ID):
149 sudo usermod -a -G vboxsf userid
153 In a VM terminal window, verify that you can access your home directory on the host computer, which should be mounted under here:
157 ----------------------------------------
163 Configure_git_and_gerrit.rst
164 Workspace_and_Development_Tools.rst