VirtualBox访问外网,并能从主机访问的设置
来源:互联网 发布:adobe软件 mac百度云 编辑:程序博客网 时间:2024/05/15 04:07
https://geert.vanderkelen.org/2011/virtualbox-give-host-only-access-to-internet/
这个配置貌似是可用的:
VirtualBox: give Host-Only access to internet
This post describes a simple trick for VirtualBox to give host-only virtual machines access the internet or access your host from the guest using NAT.
Problem
The original problem or requirements were as follows:
- The host should be able to browser the webserver on the Guest (the virtual machine)
- The guest should be able to access the outside world (intranet/internet)
- Use fixed IP address
Yes, you can use port-forwarding using NAT network interface for the virtual machine. But configuring this is just way to complicate and error prone. A few googles more, and I couldn’t find anything good.
Solution
The solution I came up with: configure 2 network interfaces for your Virtual Box host. Simple, isn’t it?
First, we need to make a new network in VirtualBox. You can do this in the GUI preference, which is a bit platform specific, but it’s not easy to miss.
Create a new network in VirtualBox, named like vboxnet2
with following settings (change to suit your needs):
- IPv4 Address: 10.88.12.0
- IPv4 Network Mask: 255.0.0.0
- Leave DHCP disabled if you don’t need it. Fixed IP addresses are just more predictable
Setup your virtual machine using 2 network adapters. The order doesn’t really matter, but you’ll need one NAT
and one Host-Only
:
- NAT (not much to configure).
- Host-Only using the network you created earlier, for example,
vboxnet2
.
Boot your virtual machine, and configure the network interfaces in your guest OS (same order as previous point):
- First interface using NAT, which you can use with the internal DHCP
- Second interface using Host-Only will use a fixed IP address and netmask which you configured earlier for the
vboxnet2
VirtualBox network. For example, 10.88.12.4.
Guest has access to outside, and host can access services running on guest. This is handy when you have a demo or develop using a service running in the virtual machine, and the virtual machine needs to access the outside world.
(If the above has been posted somewhere else: I was either blind, or it was not visible or indexed enough.)
- VirtualBox访问外网,并能从主机访问的设置
- Virtualbox怎么设置访问外网以及主机访问虚拟机
- 主机与virtualbox互相访问的网络设置
- virtualbox主机配置访问
- VirtualBox 从主机访问虚拟机中系统host only network设置
- 小米路由器设置DMZ主机 并在外网访问
- Virtualbox的虚拟机既可以访问外网,也可以与主机互通
- 主机访问VirtualBox虚拟机服务
- 从任何主机都能访问到服务器上的MySql的方法
- VirtualBox上网和主机远程访问的配置
- virtualbox centos6.7 虚拟机访问外网设置
- 利用反向ssh从外网访问内网主机
- 虚拟机和主机能ping通,虚拟机也能访问主机,但是主机就访问不了虚拟机的原因
- Linux系统入门学习:从VirtualBox中从主机访问NAT客户机
- 从外网访问局域网内的主机的方法(端口映射)
- 从外网访问局域网内的主机的方法(端口映射)
- virtualbox虚拟机系统网卡设置,既能上网,又能独立ip相互访问
- virtualbox下ubuntu访问主机共享文件夹
- <一>新手学opencv之cvSetMouseCallback笔记
- JNI传递字符串数组J-StringArray
- 2013年各大小IT公司待遇,绝对真实,一线数据!(初版)
- If you object has an "Id' property, it will be set with the generated Id from MongoDB.
- VS2010中使用C#实现向EXCEL文档中写入数据
- VirtualBox访问外网,并能从主机访问的设置
- flash随机数问题
- Java与JSON相互转换
- SharePoint 2013 开发——搜索架构及扩展
- 在Spring、Hibernate中使用Ehcache缓存
- Linux查找方法
- Oracle中定时作业(Job)使用方法详解
- UI_手势
- ZOJ 3551 Bloodsucker(概率DP)