首页 > 代码库 > Mac上VirtualBox VS Parallels Desktop 以及 Ubuntu虚拟机多网卡设置

Mac上VirtualBox VS Parallels Desktop 以及 Ubuntu虚拟机多网卡设置

在Mac上使用过要license的Parallels Desktop和免费的VirtualBox,比较结果如下:

1. VirtualBox对鼠标的捕获和控制更加友好,Parallels需要按键来释放鼠标,但是VirtualBox里面完全自动。

2. VirtualBox里面虚拟机的运行速度似乎更快,至少关机比Parallels快。

3.VirutalBox里面可以很方便地复制虚拟机,但是在Parallels Desktop里面不知道什么原因“克隆”菜单为灰色不可用。

4. VirtualBox里面多网卡配置更方便。

5. google查到的VirtualBox的文章比Parallels Desktop多得多

至少在我看来,免费的VirtualBox要比收费的Parallels要好些。接下里继续体会VirtualBox。

 

在Ubuntu里面配置静态IP使得可以连接外网:

1. 关闭虚机,在VirtualBox里面,设置虚机的一个网卡为桥接模式

2. 查看主机的DNS server

3. 开虚机,运行ifconfig和route命令,查看该网卡自动获得的IP,netmask,gateway

s1@compute1:~$ route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

10.0.1.0        0.0.0.0         255.255.255.0   U     0      0        0 eth1

192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

4. 运行命令 vi /etc/network/interfaces,设置静态IP,gateway,broadcast,netmask

auto eth0

iface eth0 inet static

address 192.168.1.15

netmask 255.255.255.0

gateway 192.168.1.1

5.配置DNS, 运行vi /etc/resolvconf/resolv.conf.d/tail, 从而在/etc/resolvconf/resolv.conf.d/目录下创建tail文件,写入

nameserver 192.168.1.1
然后重启,DNS生效
 
6.测试。ping www.sohu.com

s1@compute1:~$ ping www.sohu.com

PING fsh.a.sohu.com (114.80.130.88) 56(84) bytes of data.

64 bytes from www.sohu.com (114.80.130.88): icmp_seq=1 ttl=56 time=4.65 ms

64 bytes from www.sohu.com (114.80.130.88): icmp_seq=2 ttl=56 time=6.91 ms

64 bytes from www.sohu.com (114.80.130.88): icmp_seq=3 ttl=56 time=5.39 ms

 

Mac上VirtualBox VS Parallels Desktop 以及 Ubuntu虚拟机多网卡设置