Local access to virtualbox Virtual Machine

Source: Internet
Author: User

Virtualbox is installed in windows and several virtual systems (Debian/Ubuntu/ARCH/WINXP...) are installed ...). Today, I suddenly wanted to access the Apache server of virtual Debian. Since I have tried the bridge method before, it seems very troublesome to remember to bridge the vbox virtual network card with the local network card, and then set it in the virtual system.

 

I'm going to try another method today, so I found an article on Google.Article. The specific operation is as follows: add two NICs in the NIC settings of the virtual machine, one is host-only, the other is Nat, and then set two NICs in the virtual system respectively. Try again. In Debian, set eth0 to the static IP address of the local machine in the same network segment, set eth1 to DHCP, and then access the virtual machine from the local machine, which is indeed accessible. However, a problem occurs when accessing the Internet from a virtual machine. It cannot be accessed, or even access the local machine through 10.0.2.2. After some tossing, I finally found that the two NICs cannot work at the same time. Ifconfig eth0 down, ifconfig eth1 up, so that you can access the virtual machine through the host; ifconfig eth0 up, ifconfig eth1 down, so that the virtual machine can access the local machine and access the internet. It was depressing and never solved the problem of working at the same time, but it was finally possible to access the Virtual Machine. Although it was troublesome to use, it basically solved the need to access the virtual machine.

 

Later, I chatted with a friend and learned that I could simply add a NIC in the NIC settings of the VM and change it to a bridge adapter! It was really nice to try it! It seems that people's thinking patterns often change. The time will change the complicated things they have experienced!

 

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.