Virtual Machine Linux ---- Ubuntu1204 ---- set a fixed Ip address, ubuntu Virtual Machine

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

Virtual Machine Linux ---- Ubuntu1204 ---- set a fixed Ip address, ubuntu Virtual Machine

1. Introduction

Environment: the ubuntu version is 12.04, and the virtual machine is the Oracle Vm VirtualBox

2. Description

Requirement: A ubuntu system has been installed. The network configuration is bridging by default. You can access the Internet, and the physical machine can connect to the virtual machine operating system;

Now you need to install another one, but you don't want to install it again, so you copied one copy and chose the complete copy, but the virtual opportunity also completely copies the network configuration, instead of allocating one.

Operation: modify the configuration file of the second ubuntu operating system to complete network communication.

(1) modify the ip address information,/etc/network/interfaces. Add the following content to the bottom of the original two lines. Note that the IP address segment is the same as that of your local machine, but the last one is different, the adjustment is as follows:

Auto eth0iface eth0 inet staticaddress 192.168.1.105netmask 255.255.255.0network 192.168.1.0broadcast 192.168.1.255gateway 192.168.1.1

(2) modify the system running level,/etc/default/grub, as follows:

GRUB_CMDLINE_LINUX_DEFAULT = "text"

Note: The runlevel command can view the current running level of the system.

(3) Modify dns to avoid internet access./etc/resolvconf/resolv. conf. d/base is as follows:

Nameserver 8.8.8.8

Restart and test whether the physical machine accesses the Virtual Machine System, the virtual machine system accesses each other, and the virtual machine accesses the internet.

 

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.