让virtualbox虚拟机既能和主机通信,又能上网的方法
来源:互联网 发布:php的curl 零基础 编辑:程序博客网 时间:2024/04/28 10:45
http://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in
I can get the setup I want by setting up two adapters on the vm.
VirtualBox 4.2.12
Ubuntu 12.04 guest
In VirtualBox > Preferences > Network, set up a host-only network.
Mine is called vboxnet0, it is manually configured:
ip 192.168.56.1
netmask 255.255.255.0
no dhcp
Then, in the network settings for the virtual machine, set up two adapters:
Adapter 1
host only, vboxnet0
Adapter2
NAT
Boot the virtual machine and log in through the console VirtualBox provides.
Run this to see your adapters:
ls /sys/class/net
In my case the adapters were named eth1 and eth2 (and lo, the loopback interface).
Then, edit your network configuration.
sudoedit /etc/network/interfaces# The loopback network interfaceauto loiface lo inet loopback# Host-only interfaceauto eth1iface eth1 inet static address 192.168.56.20 netmask 255.255.255.0 network 192.168.56.0 broadcast 192.168.56.255# NAT interfaceauto eth2iface eth2 inet dhcp
Note that eth1
has no default gateway specified. eth2
will get a default gateway from dhcp.
- 让virtualbox虚拟机既能和主机通信,又能上网的方法
- 黑马程序员_怎样让VirtualBox虚拟机既可以上网又可以和主机通信
- VirtualBox虚拟机与主机互通,并且虚拟机又能上网配置
- ubuntu12.04下bridge模式上网设置的方法(让虚拟机里ubuntu终端技能ping同主机又能上网)
- 让虚拟机也能和主机同时上网
- virtualbox虚拟机系统网卡设置,既能上网,又能独立ip相互访问
- vmware centos 虚拟机与主机通信 并且能上网
- VirtualBox虚拟机与主机互通,并且虚拟机又能上网配置 标签: virtualboxoraclehost-only rac 11g 2016-07-02 14:05 10670人阅读 评论(0
- 让VMware虚拟机里的系统能上网
- 就主机能上网
- 虚拟机下实现:固定ip+能上网+主机虚拟机互连
- 虚拟机和主机能ping通,虚拟机也能访问主机,但是主机就访问不了虚拟机的原因
- 虚拟机linux能ping通主机不能上网解决办法
- ubuntu 虚拟机上不了网 主机能上网
- VirtualBox下主机Windows能ping通虚拟机下的Linux,LInux无法ping通Winodws
- VirtualBox的虚拟机上网以及虚拟机如何与主机互通
- VirtualBox的虚拟机上网以及虚拟机如何与主机互通
- 终于又能上网了
- gloox的使用
- wchar_t*与char*之间的转换
- Android开发记录四之SQLite的创建及增删改查
- HDU 4587 割点
- 如何查看pid进程号和对应的端口号
- 让virtualbox虚拟机既能和主机通信,又能上网的方法
- ubuntu 12.04 搭建 android 4.0编译环境
- varnishstat与缓存效果
- HTML高级标签(2)————窗口分帧(1)————分帧演示
- Opencascade中对于空间曲线求交的方法
- 数组作为函数参数
- adb shell input event
- JPA find() vs. getReference()
- 精品运维视频推荐-老男孩