VirtualBox installs Ubuntu in order to play happily in the future

Source: Internet
Author: User

in order to play happily in the future, Virtualbox installation Ubuntu

Every time you install a virtual machine is always to toss a bit, after all, not particularly familiar with a few small details to Google half a day, in order to be happy to play later. Keep a record of all these problems before you toss them.

This document is from other people's articles that I saved in Evernote finishing.

    1. Internet

Reference:

http://blog.csdn.net/yxc135/article/details/8458939

Http://www.cnblogs.com/adforce/p/3363373.html

Virtual Machine Network If it is home installation, choose Bridge is very convenient, bridge is equivalent to the virtual machine installed directly into the internal network. The IP address of the virtual machine is obtained from the intranet, so the network configuration of the virtual machine is the best choice of DHCP. As below, you can see that the network adapter selected by the bridge is the network card used by your host.

The advantage of bridging is that this virtual machine and your host as the use and access, very convenient, the disadvantage is that the virtual opportunity to occupy an intranet IP, and many places, such as my company, is not allowed you to use the bridge mode.

If it is not bridged, only with Nat plus host-only, the way is also very simple, on the virtual machine choose to use 2 network cards, a configuration NAT, a configuration using Host-only,host-only Interface name selection VirtualBox Host-only Network.

NAT can only allow the virtual machine to access the host's network resources, but cannot allow the host to access the virtual machine, and host-only instead provides the host access to the virtual machine's resources, but the virtual machine cannot access the host (this is a virtual network). So in general, Nic 1 (NAT) configures DHCP, and Nic 2 (host-only) configures static addresses.

So the network configuration of the virtual machine is as follows, and the host on the VirtualBox host-only network My IP address is configured 192.168.56.1

sudo vim/etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see Interfaces (5).

?

# The Loopback network interface

Auto Lo

Iface Lo inet Loopback

?

Auto Eth0

Iface eth0 inet DHCP

?

# The Primary network interface

Auto Eth1

Iface eth1 inet Static

Address 192.168.56.120

Netmask 255.255.255.0

Network 192.168.56.0

A lot of posts say restart is only required to execute/etc/init.d/networking restart. I can't test it, just reboot.

Add a sentence, at the beginning of my writing configuration when very two on the network card 2 inertial configuration Gateway 192.168.56.1, the results of the host is always unable to access the external network, puzzled half a day (Host-only would not be able to access the external network resources, and set up the gateway to let all the outside network request to go this network card).

If you need to configure a proxy online within the company, you need to set the network settings inside the VA global settings.

    1. Virtual Machine window Resolution

Reference: http://blog.csdn.net/weilanxing/article/details/7664324

Installed in the Ubuntu Server, the startup after the discovery of the console window is a bit small, not easy to use, to adjust the window size of the console, you need to modify the screen resolution, modify the method as follows:

1. Open the Grub file ($vim/etc/default/grub), modify the value of the parameter Grub_cmdline_linux, grub_cmdline_linux= "vga=0x317", Parameter Value reference:

?

| 640x480 800x600 1024x768 1280x1024

----|--------------------------------------

256 | 0x301 0x303 0x305 0x307

32k | 0x310 0x313 0x316 0x319

64k | 0x311 0x314 0x317 0x31a

16M | 0x312 0x315 0x318 0x31b

2. $sudo Update-grub

3. $sudo reboot

If I remember correctly, if the configuration is wrong, the boot will prompt you how to modify.

?

    1. Ssh

/etc/ssh/sshd_config

ListenAddress

Specifies the network address that sshd (8) listens on, and listens to all addresses by default. You can use the following format:

Port

Specifies the port number that the sshd (8) daemon listens on, which defaults to 22. You can listen to multiple ports using multiple instructions.

The default is to listen on all network interfaces on this computer, but you can specify to listen on only one particular interface through listenaddress.

Protocol

Specifies the version number of the SSH protocol supported by SSHD (8).

' 1 ' and ' 2 ' indicate only support for SSH-1 and SSH-2 protocols. "2,1" indicates support for both SSH-1 and SSH-2 protocols.

?

    1. The source of Ubuntu home

Thanks to the great gfw. Domestic visit to the foreign Ubuntu Atp-get source is very slow.

BTW: Recently recommended source of Sohu, 163 of the source seems to always have a problem.

sudo cp/etc/apt/sources.list/etc/apt/sources.list_bak

sudo vim/etc/apt/sources.list

?

Http://wiki.ubuntu.org.cn/%E6%BA%90%E5%88%97%E8%A1%A8

Http://www.ha97.com/4950.html

?

    1. Virtual machine and Host shared directory

Virualbox does not lose to VMware at all, and can also specify external directories and virtual machine shares, but it also requires the installation of attachments and the need to install VirtualBox Guest additions.

1. First, select device--Install enhancements

2. Then install the following packages:

sudo aptitude install build-essential

3. Mount the CD-ROM.

sudo mount/dev/cdrom/mnt/

4. Install the Enhancement package

Sudo/mnt/vboxlinuxadditions-x86.run

5, uninstall CDROM

sudo umount/mnt/

6, share the files in Windows, I set the VirtualBox in the space called Vbshare, so in Ubuntu enter the following command

sudo mkdir/mnt/share

sudo mount-t vboxsf vbshare/mnt/share

If you want to start it, add a sentence in the/etc/rc.local file.

Mount-t vboxsf Vbshare/mnt/share

?

VirtualBox installs Ubuntu in order to play happily in the future

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.