-------------------------------------
|主题:
-------------------------------------
在win7物理机器上使用VirtualBox管理Ubuntu虚拟机
-------------------------------------
|目的:
-------------------------------------
我的物理机是win7/64bit操作系统;
先后尝试了以vmware做为虚拟容器安装centos6.3,然后尝试了以VirtualBox做为虚拟容器安装Ubuntu;
结果实现了 虚拟机与物理机器之间的互通,并且虚拟机都可以连接上外网网络,可以上网;
-------------------------------------
|流程:
-------------------------------------
提前说明基本的配置流程:
1.从本物理机网卡中得到连接的网段与网关;以此实现各个虚拟机与真机之前的互联;
2.虚拟机的网卡设置为桥接方式;这里测试发现vmnet1,vmnet8完全无需设置,甚至禁用掉都不手影响;因为这里依赖的是桥接到真机的网卡。
3.配置虚拟机的网卡,手动、静态ip,尤其注意网关的配置与第一条得出的网关保持一样。
4.配置域名服务器地址;看看/etc/resolv.conf 是怎么配置的,/etc/resolv.conf 可能会重启失效,这里要注意真正配置的地方在哪里。
首先看看配置VirtualBox的配置截图;
sudo /etc/init.d/resolvconf restart 使得生效;
参考:http://blog.163.com/wangdong8213@126/blog/static/45852366201243113241760/
其次再看看Vmware设置的截图;
然后就是/etc/resolv.conf的配置;
其他问题:
Linux Ubuntu 修改网卡名字/Ubuntu14.04下如何配置固定IP
http://blog.youkuaiyun.com/u011521019/article/details/70218642
克隆多台:
C:\Program Files\Oracle\VirtualBox>VBoxManage clonevdi "D:\fs\programdata\virutalmachinedisk\ubuntu_a\ubuntu16.04_a.vdi" "D:\fs\programdata\virutalmachinedisk\ubuntu_b\ubuntu16.04_b.vdi"
0%...10%...
Ubuntu在 NAT+HostOnly双网卡下,实现既能连接互联网又能联通本机的网络配置:
root@ubuntu:~# 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).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet dhcp
nameserver 8.8.8.8