virtualbox 网络最佳配置
来源:互联网 发布:scala编程思想怎样 编辑:程序博客网 时间:2024/06/02 10:58
故用NAT方式,但是vb提供的初始NAT方式无法实现主机连到客户机,因为被一个叫vb engine的东西给隐藏起来了,
所以主机虚拟机无法通信。这个时候就要配置下vb了。具体如下:
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. For example, to set up incoming NAT connections to an ssh
server in the guest, use the following command:
VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,,22"
With the above example, all TCP traffic arriving on port 2222 on any host interface will be forwarded to port 22 in the guest. The protocol name tcp
is a mandatory attribute defining which protocol should be used for forwarding (udp
could also be used). The name guestssh
is purely descriptive and will be auto-generated if omitted. The number after --natpf
denotes the network card, like in other parts of VBoxManage.
To remove this forwarding rule again, use the following command:
VBoxManage modifyvm "VM name" --natpf1 delete "guestssh"
If for some reason the guest uses a static assigned IP address not leased from the built-in DHCP server, it is required to specify the guest IP when registering the forwarding rule:
VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,10.0.2.19,22"
This example is identical to the previous one, except that the NAT engine is being told that the guest can be found at the 10.0.2.19 address.
我自己的机器上就用VBoxManage modifyvm "VM name" --natpf1 delete "guestssh"就可以了。
然后主机运行putty, ip填入localhost, 端口为2222,这里要大于1024.
这样主机就可以和虚拟机用ssh连入了。
不过缺点是主机和客户机无法使用我写的ipmsg来传文件了,因为不支持UDP广播。
看来要用FTP了,同样也要做个nat。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~从网上得到的~~~~~启示~~~~~~~~~~~~~~~~~~~~~~~~~~~~
其实呢,不必这么麻烦的。
只要再给vb增加一块网卡就解决问题了。
哈哈
一块是NAT,一块为Host only
Done! Cool!
- virtualbox 网络最佳配置
- virtualbox 网络配置(图)
- VirtualBox网络配置
- VirtualBox网络配置
- VirtualBox网络配置
- VirtualBox网络配置
- ubuntu VirtualBox 网络配置
- VirtualBox网络配置
- VirtualBox网络配置
- VirtualBox + Ubuntu 网络配置
- VirtualBox网络配置
- VirtualBox配置网络方式
- VirtualBox的网络配置ubuntu
- VirtualBox中centos网络配置
- VirtualBox中centos网络配置
- virtualbox虚拟机的网络配置
- VirtualBox中centos网络配置
- win7 virtualbox centos 网络配置
- MFC编程时如何给程序设置热键
- 3.linux启动流程分析(代码分析)
- Android 开发中使用 SQLite 数据库
- MYSQL编码
- live555 实现一个最简单的RTSP服务器
- virtualbox 网络最佳配置
- struts2文件上传下载
- appdelegate中的方法
- 提高 Linux 上 socket 性能
- 给Android应用开发者的十个建议
- Ubuntu 11.10 编译的时候找不库的头文件怎么办?
- [C#] 全局键盘获取组件
- php 判断多维数组中是否存在指定的 values foreach(),in_array(),
- mongodb指南(十) - developer zone - 集合