Install ubuntu12.04/ubuntu14.04 Virtual Machine in virtualbox

Source: Internet
Author: User
Tags hosting sites oracle vm virtualbox vm virtualbox

Note: Ubuntu 14.04 was first installed and was re-installed. I used 12.04 installation, and then added a few more when 14.04 was installed. This installation process is applicable to ubuntu12.04 and 14.04.

 

1. Differences between Ubuntu 1.1 and Server Edition

The desktop version and server version are the same as the release version. The only difference between the two is their intended use. Desktop layout for personal computer users, text processing, Web browsing, multimedia playback and playing games. Essentially, this is a multi-purpose operating system customized for common users. On the other hand, the server version serves as a web server to host files, webpages, and similar content. [1]

A Gui (graphical user interface) is an essential component of a personal computer ). By default, Ubuntu Desktop has gnome gui. However, you can convert it to KDE or X if necessary. The server version does not have a GUI installed. In addition to routine maintenance, the server is not intended to be used for local interaction. Therefore, the GUI is not only unnecessary, but also consumes additional resources of the server. The same applies to other software, such as office software, media playback software, and browsers. None of these can be found on the server version.

Server-oriented, server version Ubuntu contains all the software you need to start hosting sites. Lamp (Linux, Apache, MySQL, and PHP) lists software related to Web servers. These cannot be found on the desktop unless you install them on your own.

The above differences are not static. By installing and uninstalling software packages, you can also customize the desktop version as the server version, and vice versa. Most people who want to install servers still need the convenience of the GUI, so they can start from any version, and then just install the GUI or lamp.

Summary:

1. The desktop version is configured for personal computers, and the server version is applicable to Web servers.
2. The desktop version is pre-installed with the GUI, but the server version is not.
3. The desktop version has installed software that is not available in many Server versions.
4. The desktop version lacks Apache, MySQL, and PHP, and these are standard configurations in the server version.

Therefore, we should select the desktop version.

1.2 i386 vs amd64

On the Ubuntu official website, if you download a 32-bit file, the ISO file ends with i386.iso. If you download a 64-bit file, the ISO file ends with amd64.iso.

I386 is a 32-bit x86 processor.
Amd64 is a 64-bit processor. Intel has its own 64-bit, but is not backward compatible. 64-bit is first introduced as amd64, which is often called amd64.

 

2 Installation Process

1. Click new to bring up a new Virtual Machine creation window.

2. Allocate the memory size to the VM.

The memory allocated to the VM is allocated only when the VM is powered on. If the VM is not started, it is not allocated.

3. Create a virtual hard disk file.

4. Select VDI format, which is the virtualbox format.

5. virtual hard disk file type: Select dynamic allocation.

6. Select the disk file storage location and the maximum disk capacity.

By default, it is stored in "C: \ Users \ XXX \ virtualbox VMS \ ubuntu_14_04". To not occupy disk C space, you can move it to the folder created on the disk.

(Note: About the maximum disk capacity, 32 GB was allocated when ubuntu14.04 was installed, but it is still 20 GB because it is not re-displayed .)

7. Virtual Disk summary information

8. The summary information of the entire creation process.

9. Click Create to return to the main window of virtualbox.

10. Modify the startup sequence: remove the soft drive and place the hard drive in front of the optical drive.

11. Insert the CD image to the Virtual Computer

12. Click OK and return to the main window.

13. Click start to start installation.

(1) Select a language: English

(2) Click Install ubuntu.

14. Prepare to install Ubuntu

Keep the default option and continue.

15. Install type

Select "other options (something else)" to customize manual partitions.

16. The following is the most important partition.

(1) Click "new partition table...". A dialog box is displayed asking if you want to create an entire disk as an empty partition and select "continue.

(2) A 20 GB free space will be created.

17. Click "add" to add a disk.

Click "free space" and then click "add ".

For more information, see [2:

(The disk space is allocated by 32 GB .)

Note the following two points:

A. If you partition/boot separately, make sure that the split slot is located at the beginning of the entire hard disk. Therefore, we select "primary" for/boot to make it the primary partition ., The "/" partition does not have to be a primary partition.

B. You cannot refer to the partition sequence in [2] When partitioning:

"/" Partition (logical)-> "/Boot" partition (primary partition)-> "Swap" partition (logical)-> "/home" partition (logical)

Because ubuntu does not take the initiative to adjust the location of the primary partition to the top. After partitioning, the remaining free space hard disk space will be displayed as unavailable, so you cannot continue partitioning.

In ubuntu, follow the steps to create a "primary partition" and then a "logical partition". Generally, the swap partition is placed at the end. Therefore, the partition order should be:

"/Boot" partition (primary partition)-> "/" partition (logic)-> "/home" partition (logic)-> "Swap" partition (logic)

(1)/boot split slot

Allocate 10 MB space. (If you enter 102 m or 100 m, 99 m is allocated. Therefore, enter m here, and the system will allocate m to the root directory)

(2) Split slot of the root directory (/)

The root directory is allocated a size of MB.

(3) Partition slot of the/Home Directory

Allocate 1 million space

(4) memory swap space (SWAP)

Allocate 1.5 MB space (generally-2 times the allocated memory size)

Because swap is a memory replacement space, there is no need for a mount point. Select "Swap" in "file system type", as shown in!

(5) final allocation result.

At last, the remaining m is reserved for the command to practice disk operations later.

After the partition is complete, click Install now to start installing the system.

As you can see, partition by "/Boot" (primary partition)-> "/" partition (logical)-> "/home" (logical) -> after the "Swap" partition (logic) is created in sequence, the SDA naming order is: sda1-> sda5-> sda6-> sda7.

If you partition by "/" partition (logical)-> "/Boot" (primary partition)-> "Swap" partition (logical)-> "/home" (logical) the naming order of SDA is sda5-> sda2-> sda3-> sda4. The remaining free space hard disk space is displayed as unavailable and cannot be further partitioned.

18. After installation starts, select "Shanghai"

19. Select "Chinese" for the keyboard layout ".

20. Enter the computer name and create a user name.

21. Now the system is installed.

22. After the installation is complete, restart the system. Note that you need to click the Enter key to restart the instance.

23. Activate the root account

(1) After Ubuntu 12.04 is installed, the default root account is disabled.

This is mainly to protect the security of the system. However, in some cases, to install software or perform other operations, you need to obtain the root permission and use the root account.

First, you need to open the Super Terminal: CTRL + ALT + T shortcut to open the Super Terminal

Enter sudo passwd Root

The system will prompt you to enter the current user's password first, then prompt you to enter a new password for the root account, and then enter a confirmation.

(2) switching between root users and normal users

Normal users switch to the root user: Execute sudo root and it will prompt you to enter the root password.

The root user switches back to the normal user. There are three methods: su XXX (XXX is the user name when you install it), or directly enter exit, or press Ctrl + D to exit.

24. How can I log on as a root user?

After the environment is installed, you only have two users to choose from when you restart the system: the user set during system installation, and a guest user, cannot use the root user to log on. However, only the root user has the permission to set and install the enhancement function. So we need to call out the root user.

(1) At the beginning, refer to the methods in [4:

Because the Ubuntu 12.04 connector is changed to lightdm, the root user has been blocked. You need to replace the connector with running agent to use the other option.

Install IIS: sudo apt-Get install IIS

After the execution is complete, the following dialog box is displayed. (If the following dialog box is not automatically displayed, run sudo dpkg-reconfigure TPD. Then the following dialog box is displayed, and the logon manager is changed ,)

(2) However, the above [4] solution has a big problem, and finally switched to [5.

But in step 5, VI/etc/lightdm. conf uses the VI editor. However, the VI editor's upper, lower, and left keys do not work (press the up key to press the letter D). After reading [6], this problem only occurs in Ubuntu and VIM needs to be installed.

(3) install VIM:

Sudo apt-Get install Vim

Make sure that the VM can access the Internet. Because apt-Get requires the root permission, add sudo and then prompt to enter the password of the current user. Of course, you can switch to the root user first, and then directly execute apt-Get install vim.

(4) After the installation is complete, follow the [5] solution settings:

A. Switch to root login,

Su Root

B. Input Vim/etc/lightdm. conf.

In ubuntu14.04, the position is changed to [7]:/usr/share/lightdm. conf. d/50-ubuntu.conf

C. edit the file.

First, use the down button to move the cursor to the last line.

Then, enter the command "O": open a new line under the current line.

Then, add the following two lines:

# manually input user when login, so root can be inputgreeter-show-manual-login=true# disable guest userallow-guest=false

After editing, Press ESC, press W to save, press WQ to save and exit, and press Q to exit without editing the file. Press: Q to exit, and press: q! Yes. Save the edited files and exit. Here, press: WQ to save and exit. The modified file is:

[SeatDefaults] greeter-session=unity-greeter user-session=ubuntu # manually input user when login, so root can be inputgreeter-show-manual-login=true# disable guest userallow-guest=false

D. Restart logon.

Shutdown-H now shut down now

Shutdown-R now restart now

Shutdown-R + 3 restart after three minutes

E. After restarting, click Login and enter the username: Root. Press enter and enter the password. You can log on to the system.

Press CTRL + ALT + T to open the Super Terminal. The prompt is displayed as the root user.

25. Install enhancements

Devices-> install guest additions. However, the system always prompts that the enhancement feature fails to be installed, and the system always prompts force release. This is because the virtual optical drive already has a cd (ISO) and is in use and cannot be umount. As a result, addition. ISO cannot be mounted. Disable the VM and release the VM on the VM management interface ,.

Start the VM and enter ubuntu. After the VM is restarted, click Login and enter the username: Root. Press enter and enter the password. You can log on to the system. Then choose to install the enhancement feature.

However, an error occurred during installation. The error message is:

Verifying archive integrity... all good.
Uncompressing virtualbox 3.2.6 guest additions for Linux ........
Virtualbox guest additions Installer
Removing installed version 3.2.6 of virtualbox guest additions...
Building the virtualbox guest additions Kernel Modules
Building the main guest additions module... fail.
Installing the window system drivers
Warning: Unknown version of the X Window System installed. Not installing
X Window System drivers.

This is because the virtualbox version is too old [8 ]. My virtualbox version is 4.1.18.

Download the latest versions of virutalbox and virtualbox extension pack 4.3.2. Overwrite the installation.

26. Upgrade virtualbox

Upgrading the virtualbox version is easy. You can install it one by one. If you run the "Start" virtual machine, it will prompt you with the following information:

"Implementation of the USB 2.0 controller not found!

The device will be disabled. you can ignore this warning but there will be no USB 2.0 support in your VM. to fix this issue, either install the 'oracle VM virtualbox extension package' or disable USB 2.0 support in the VM Settings"

This is because the corresponding version of virtualbox extension pack is not installed [9 ]. Install the virtualbox extension pack of version 4.3.2.

Open the virtualbox program and choose File> preferences> extensions.

Click "Remove package" to delete the virtualbox extension pack of earlier version 4.1.18, click "add package", and select the virtualbox extension pack of version 4.3.2 that you just downloaded. After you press OK, it will be automatically installed. The installation is complete.

27. Continue to install the enhancement feature.

Start the Ubuntu virtual machine. Note: Before starting a virtual machine, enable the settings of the Ubuntu Virtual Machine and select "Storage" to remove the previously loaded virtual image. Then start the Ubuntu virtual machine.

After starting the virtual machine, select the "devices" menu-> "insert guest additions CD images" option, and it will prompt you whether to install the enhancement function. Click "run" to automatically install it. After the installation is successful, the following information is displayed:

28. Set the shared directory with the Host OS

Select "devices"-> "share folder Settings"-> click "+" on the rightmost side to add a shared

29. Restart Ubuntu to complete installation and configuration.

After setting, restart ubuntu. This time, you can find that the screen size and resolution of ubuntu after startup are larger, just like that of Host OS. Indicates that the enhancement function is successfully installed.

In addition, the/Media Directory can access the D disk of the Host OS, indicating that the sharing is successful.

30. Set clipboard sharing between host OS and Guest OS

In ubuntu14.04, content cannot be copied between the VM and the host, because virtualbox is disabled by default.

Click "machine"-> Settings-> General-> advanced-> shared clipboard

Select bidirectional for Bidirectional replication.

31. Modify the default folder

After virtual box is installed, the default folder is placed on drive C. You can change it to another disk.

Modify file> preferences> General> default machine Folder:

C: \ Users \ MSI \ virtualbox VMS

-> D: \ linuxvirtual

Modify "machine"-> Settings-> General-> advanced-> snapshot Folder:

C: \ Users \ MSI \ virtualbox VMS \ ubuntu_14_04 \ snapshots

-> D: \ linuxvirtual \ ubuntu_14_04 \ snapshots

 

References

[1] Ubuntu Desktop edition and Server Edition (http://article.yeeyan.org/view/163202/149829)

Disk partitioning (http://vbird.dic.ksu.edu.tw/linux_basic/0157installcentos5_2.php#centos5_4)

[3] big hard disk with old host (http://vbird.dic.ksu.edu.tw/linux_basic/0130designlinux.php#largehd)

[4] Ubuntu 12.04 how to use Root User Login (http://blog.sina.com.cn/s/blog_448aed2001015pw8.html)

[5] authentic Ubuntu 12.04 12.10 root login (http://blog.csdn.net/happyteafriends/article/details/7518893)

[6] I use virtual machine Linux, command interface, want to play something in the VI Editor, how always error (http://zhidao.baidu.com/question/398969068.html? Qbl = relate_question_1)

[7] Ubuntu 14.04 Root User Login (http://blog.sina.com.cn/s/blog_8cae15e90101pwq4.html)

[8] about the virtual machine Ubuntu installation enhancement (http://bbs.chinaunix.net/thread-3586960-1-1.html)

Virtualbox4.1.0 installation virtualbox extension pack, supports USB 2.0 (http://blog.chinaunix.net/uid-23440786-id-3575575.html)

Install ubuntu12.04/ubuntu14.04 Virtual Machine in virtualbox

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.