翻译比较累,直接贴上原文:

6.3.1. Configuring port forwarding with NAT
As the virtual machine is connected to a private network internal to VirtualBox and invisible to the host, network services on the guest are not accessible to the host machine or to other computers on the same network. However, VirtualBox can make selected services available outside of the guest by using port forwarding. This means that VirtualBox listens to certain ports on the host and resends all packets which arrive on them to the guest on the ports used by the services being forwarded.

To an application on the host or other physical (or virtual) machines on the network, it looks as though the service being proxied is actually running on the host (note that this also means that you cannot run the same service on the same ports on the host). However, you still gain the advantages of running the service in a virtual machine -- for example, services on the host machine or on other virtual machines cannot be compromised or crashed by a vulnerability or a bug in the service, and the service can run in a different operating system than the host system.

You can set up a guest service which you wish to proxy using the command line tool VBoxManage. You will need to know which ports on the guest the service uses and to decide which ports to use on the host (often but not always you will want to use the same ports on the guest and on the host). You can use any ports on the host which are not already in use by a service. An example of how to set up incoming NAT connections to an ssh server on the guest requires the following three commands:

VBoxManage setextradata "Linux Guest"

"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP

VBoxManage setextradata "Linux Guest"

"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22

VBoxManage setextradata "Linux Guest"

"VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222

The above example assumes a PCNet virtual network card; if you have configured the guest to use the Intel PRO/1000, replace "pcnet" with "e1000" in the above commands. Similarly, if you want to configure a different interface instance replace the /0/ with the appropriate index. pcnet and e1000 are counted separately in this respect, and counting starts at 0 for both types.

The name guestssh is an arbitrary one chosen for this particular forwarding configuration. With that configuration in place, all TCP connections to port 2222 on the host will be forwarded to port 22 on the guest. Protocol can be either of TCP or UDP (these are case insensitive). To remove a mapping again, use the same commands, but leaving out the values (in this case TCP, 22 and 2222).

It is not possible to configure incoming NAT connections while the VM is running. However you can change the settings for a VM which is currently saved (or powered off at a snapshot).

访问virtualbox虚拟机中架设的网站相关推荐

  1. 启用数据空间:让VirtualBox虚拟机中的Ubuntu 10.10和XP主机互通有无

    已经在virtualbox + U12 验证ok mount到mnt下. From:http://www.linuxidc.com/Linux/2010-12/30237.htm 在virtualbo ...

  2. 启用数据空间:让VirtualBox虚拟机中的Ubuntu10.10和XP主机互通有无

    启用数据空间:让VirtualBox虚拟机中的Ubuntu10.10和XP主机互通有无 在virtualbox中安装好Ubuntu10.10后,如果想将xp中的文件传到ubuntu系统中或把ubunt ...

  3. VirtualBox虚拟机中Ubuntu11.10安装Additions出现 读写错误的解决办法

    VirtualBox虚拟机中Ubuntu11.10安装Additions出现 读写错误的解决办法 其主要原因是硬盘的控制器的冲突造成的,考虑到兼容性,将硬盘的控制器统一改成ide即可,还用原来的虚拟文 ...

  4. 在vmware/virtualBox 虚拟机中使用adsl拨号上网

    在vmware/virtualBox 虚拟机中使用adsl拨号上网 将虚拟机网卡设置成桥接到宿主机物理网卡, 设置请参考:VMware/VirtualBox 中设置虚拟机桥接到双网卡服务器的某一个网卡 ...

  5. 怎样在VirtualBox 虚拟机中挂载共享目录

    啊.好长时间没写博客了.近期有点忙~~ 不得不说 VirtualBox 对于一些不想装非常多个系统又非常想实验新系统的人来说确实是神器: 哈哈.个人还是比較爱玩这些个各种各样的Linux 发型版的,可 ...

  6. 本机访问VMware虚拟机中网页的方法

    虽然大部分开发者现在使用的开发机器都是Mac,但是不排除还有相当多的一部分开发机器是windows(就比如笔者我自己).从网上找到开源的某些项目,想要直接运行Demo时,Win操作系统就很尴尬,这个时 ...

  7. [转载]一步一步教你如何在Virtualbox虚拟机中安装Remix

    原文地址:https://bbs.jide.com/forum.php?mod=viewthread&tid=4892 大神请路过-- [准备工具] 1.Virtualbox虚拟机(这个是免费 ...

  8. docker安装mysql远程不能访问_虚拟机中docker安装mysql远程无法访问

    问题:虚拟机中docker安装mysql远程无法访问 背景: [root@localhost ~]# docker run -p 3306:3306 --name mysql01 -e MYSQL_R ...

  9. 解决virtualbox虚拟机中kali linux无法使用wlan0

    在Windows10系统上安装的virtualbox虚拟机,在虚拟机中安装的Kali Linux系统看不到无线网卡信息 在虚拟机设置中,选择"网络",使用"bridged ...

  10. VirtualBox虚拟机中使用U盘等USB设备的设置方法

    默认安装完Virtualbox,新建系统后,插入U盘,实机可以使用,但是虚拟机中不能正常使用USB设备.这个时候我们需要简单地设置.下面介绍的就是在ubuntu系统下,使用virtualbox安装wi ...

最新文章

  1. C# Task 循环任务_理解C#中的ValueTask
  2. BugkuCTF多种方法解决
  3. 不同版本的Chrom浏览器对应的ChromDriver的版本
  4. go genetlink demo
  5. 3台廉价机器每秒写入2百万!Kafka为什么那么快?
  6. 缺氧游戏计算机,缺氧PC最低什么配置一览 你觉得高吗
  7. C++ 移动和获取文件读写指针
  8. Hemberg-lab单细胞转录组数据分析(一)
  9. C++判断函数执行效率方法封装
  10. laravel 核心类Kernel
  11. USB TYPE A B C 引脚定义
  12. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fa
  13. 游戏项目开发的简单流程
  14. Photoshop2022全版本软件安装包(附图文教程、windows\mac系统全版本软件)
  15. Excel成神之道-001-数据分列
  16. Culling技术的一些介绍
  17. arduino nano 蓝牙_ESP32模拟无线蓝牙鼠标自制翻页笔神器
  18. BDTC 2017数据库:犹他大学、东方国信、蚂蚁金服、微软、人大金仓畅谈数据库发展与实践...
  19. Java多文件压缩下载解决方案
  20. 疯狂Java讲义(六)----第二部分

热门文章

  1. openLayers 加载点线面等基础用法
  2. 应届生会Python年薪35w!薪资比职场老人还高?
  3. NFS或iSCSI哪个更好
  4. 【算法专题】Morris遍历
  5. [2021.7.23][1 容器] 1. 慎重选择容器类型
  6. CSS 适配 iPhoneX
  7. vue+Nodejs+Koa搭建前后端系统(一)--简易版
  8. 嵌入式开发-创新(源于挑战)
  9. 2019年_BATJ大厂面试题总结-贝壳篇
  10. 后奥运行情方向不明,A股患上“忧郁症”