网络配置
网络模式 Host-only Internal Bridged NAT 之间的区别
https://www.virtualbox.org/manual/ch06.html
virtualbox 各网络连接方式的访问性如上图所示
vmware和virtualbox的nat网络模式有个很大的区别,在vmware的nat模式下vm能够访问互联网,且host够与vm互通。而virtualbox下host与vm是不通的,需要配置端口转发
网络配置最佳实践
- 如果你希望外网其他机器访问你的虚拟机且能够确保使用某一固定ip不会与他人冲突那么你可以直接使用Bridged模式
- 如果你的虚拟机需要访问外网,但是你的公司对网络访问进行了较强的限制,例如登录认证,ip固定分配等等,你应该使用双网卡配置:NAT(网卡1)+ host-only(网卡2),通过NAT进行外网访问,通过host-only的ip访问和操作该虚拟机。这就相当于vmware的nat网络模式。
移动虚拟机
- 全局设定修改存储路径后
- 移动原存储路径文件到新路径
- 控制-注册 .vbox文件 https://www.jianshu.com/p/a05615d1a17c
安装增强功能 VBoxGuestAdditions
VBoxGuestAdditions类似于vmware的vmware tools 使用 设备-安装增强功能菜单,挂载安装光盘
#安装依赖项
yum install kernel-devel bzip2 gcc make -y
#挂载光盘
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom
#安装
sh ./VBoxLinuxAdditions.run
#卸载
sh ./VBoxLinuxAdditions.run uninstall
Before installing the Guest Additions, you will have to prepare your guest system for building external kernel modules. This works similarly as described in Section 2.3.2, “The VirtualBox driver modules”, except that this step must now be performed in your Linux guest instead of on a Linux host system, as described there.
If you suspect that something has gone wrong, check that your guest is set up correctly and try executing the command
rcvboxadd setup as root.
Insert the VBoxGuestAdditions.iso CD file into your Linux guest's virtual CD-ROM drive, exactly the same way as described for a Windows guest in Section 4.2.1.1, “Installation”.
Change to the directory where your CD-ROM drive is mounted and execute as root:
sh ./VBoxLinuxAdditions.run
参考:https://docs.oracle.com/cd/E97728_01/E97727/html/guestadd-install.html#additions-linux
来源:oschina
链接:https://my.oschina.net/u/4257185/blog/3545188