• Sharing Host VPN with VirtualBox guest

After looking for this solution everywhere, I finally found a working solution that doesn't require a lot of configuration changes and is really simple. Use the default NAT network and type this in the terminal:

VBoxManage modifyvm "VM name" --natdnsproxy1 on

$ VBoxManage list vms
"Linux_VM_Lab" {9844011a-321e-4975-9799-24deebec696c}

$ VBoxManage modifyvm 9844011a-321e-4975-9799-24deebec696c --natdnsproxy1 on

  • Building an Internal Network in VirtualBox

TCP port forwarding

The VirtualBox NAT interface is a NAT firewall that connects guest virtual machines to the host computer’s local area network. It supports DHCP configuration of IP addresses.

Because the virtual machines are hidden behind a NAT firewall, the host computer cannot initiate connections to them. To connect from the host computer to the virtual machines using SSH, you must set up TCP port forwarding on each virtual machine.

TCP port forwarding creates a hole in the NAT firewall through which the host computer or other clients from the local area network may initiate connections to the virtual machines.

The default SSH port on each guest virtual machine is TCP port 22. Map unused TCP port numbers on the host computer to port 22 on each guest virtual machine. Any unassigned or unreserved TCP port numbers may be used on the host computer. I prefer to use TCP port numbers between between 14415 and 14935 which provides 520 contiguous unassigned TCP port numbers1.

Configure port forwarding on NAT interfaces

On each virtual machine, click on Settings, then click on the Network tab in the settings window. Select the tab for Adapter 1. Expand the Advanced network panel and click on Port Fowarding.

To log into any running virtual machine, use the host computer’s IP address and the host port number assigned to the virtual machine:

$ ssh -l <userid> -p <port number> <IP address>

Refrence:

https://sandilands.info/sgordon/building-internal-network-virtualbox

http://www.brianlinkletter.com/how-to-use-virtualbox-to-emulate-a-network/

VirtualBox Network Config的更多相关文章

  1. VirtualBox network / study environment setup for RHEL

    I re-visited the RHEL study material and setup the environment again, noted down the procedure. 1, c ...

  2. network config

    ifcfg-ens32 --static TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes ...

  3. VirtualBox Network设置的NAT和Bridged Adapter模式区别

    区别: NAT模式下,虚拟机仍然可以访问网络,但是从网络接收者的眼中看来,这些网络请求都来自宿主机,而感知不到虚拟机.外网也无法访问虚拟机网络.虚拟机和宿主机器的IP地址在不同的子网,比如192.16 ...

  4. "%Error opening tftp://255.255.255.255/network config"

    问题:服务配置错误消息(Service Configuration Error Messages) 有时,在通过Cisco IOS软件启动Cisco设备期间,会显示与这些类似的错误消息: %Error ...

  5. 使用 Vagrant + VirtualBox 快速构建 CentOS 下的 Docker 环境

    Vagrant - 基础概念: Vagrant 是什么? Vagrant是一款用于在单个工作流程中构建和管理虚拟机环境的工具.凭借易于使用的工作流程和专注于自动化,Vagrant降低了开发环境设置时间 ...

  6. VirtualBox上使用kubeadm安装Kubernetes集群

    之前一直使用minikube练习,为了更贴近生产环境,使用VirtualBox搭建Kubernetes集群. 为了不是文章凌乱,把在搭建过程中遇到的问题及解决方法记在了另一篇文章:安装Kubernet ...

  7. 环境篇:Virtualbox+Vagrant安装Centos7

    环境篇:Virtualbox+Vagrant安装Centos7 1 安装Vagrant Vagrant下载地址:https://www.vagrantup.com/ Vagrant百度网盘:https ...

  8. Network Basic Commands Summary

    Network Basic Commands Summary set or modify hostname a)     temporary ways hostname NEW_HOSTNAME, b ...

  9. Configuring Network in CentOS 6.3 Virtual Box + Screenshots

    Configuring Network in CentOS 6.3 Virtual Box + Screenshots Posted: May 23, 2013 in Uncategorized Ta ...

随机推荐

  1. Angular(01)-- 架构概览

    声明 本系列文章内容梳理自以下来源: Angular 官方中文版教程 官方的教程,其实已经很详细且易懂,这里再次梳理的目的在于复习和巩固相关知识点,刚开始接触学习 Angular 的还是建议以官网为主 ...

  2. postgres的使用命令

    1.更新源 yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos1 ...

  3. sed和awk用法

    sed和awk用法 Sed sed是一个很好的文件处理工具,本身是一个管道命令,主要是以行为单位进行处理,可以将数据行进行替换.删除.新增.选取等特定工作,下面先了解一下sed的用法sed命令行格式为 ...

  4. Python项目,VS Code控制台输出乱码问题解决办法

    一.添加系统变量 在window环境变量中,添加环境变量 PYTHONIOENCODING = UTF-8. 二.在文件中设置输出编码 import io import sys sys.stdout ...

  5. 【死磕Java并发】-----Java内存模型之happens-before

    在上篇博客([死磕Java并发]-–深入分析volatile的实现原理)LZ提到过由于存在线程本地内存和主内存的原因,再加上重排序,会导致多线程环境下存在可见性的问题.那么我们正确使用同步.锁的情况下 ...

  6. Yii2 解决2006 MySQL server has gone away问题

    Yii2 解决2006 MySQL server has gone away问题 Yii2版本 2.0.15.1 php后台任务经常包含多段sql,如果php脚本执行时间较长,或者sql执行时间较长, ...

  7. spring-boot-starter-mail技术总结

    1. spring-boot-starter-mail技术总结 1.1. 配置读取类SMTPTransport 在application中需要配置的信息,在此类中都可以看到,可以在此类打断点查看 1. ...

  8. Java实现点击导出excel页面遮罩屏蔽,下载完成后解除遮罩

    一.问题场景 最近在做数据统计功能,需求是导出大数据量的excel,时间间隔较长,大概需要十秒左右,点击导出后,页面没有做任何处理,用户也不知道是否正在导出:如果没有做交互上的限制,用户可以一直点击导 ...

  9. 《IDEO,设计改变一切》(Change By Design)- 读书笔记

    一.关于IDEO与设计思维 IDEO是一家世界顶级创意公司,而作者蒂姆布朗是IDEO的CEO.当然,在未阅读本书之前,我都是不知道的,也不会主动去了解IDEO和蒂姆布朗的.那么,我为什么要去读这样一本 ...

  10. docker-swarm建立本地集成开发环境

    在k8s出现之后,docker-swarm使用的人越来越少,但在本地集成开发环境的搭建上,使用它还是比较轻量级的,它比docker-compose最大的好处就是容器之间的共享和服务的治理,你不需要li ...