Skip to content

Instantly share code, notes, and snippets.

@chzyer
Created January 11, 2013 05:58
Show Gist options
  • Save chzyer/4508299 to your computer and use it in GitHub Desktop.
Save chzyer/4508299 to your computer and use it in GitHub Desktop.
电脑连接virtualBox虚拟机ubuntu server

virtualbox默认配置是虚拟机能访问到物理机,而物理机没办法访问到虚拟机,要解决这个问题就要配置双网卡, 选择网卡2,设置为host-only 进入ubuntu,首先,第二块网卡的连接名是eth1,目前还没有连接,特征是ifconfig里面看不到,而如果加上-a参数就能看得到eth1但没有IP地址。 先配置他自动启动

cd /etc/network
sudo nano interfaces

最后加上

auto eth1
iface eth1 inet dhcp

保存 刷新设置

sudo /etc/init.d/networking restart

就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment