在VirtualBox下,设备-更改网络连接,连接方式可以设置为Bridged Adapter,界面名称选择本机网卡。
启动 linux虚拟机,用root账户登录,不然没权限。
vim /etc/network/interfaces
在里面的设置如下
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.68
netmask 255.255.255.0
gateway 192.168.0.1
保存并重启网络
/etc/init.d/networking restart
测试Internet网络
ping 192.168.0.1