当前位置:网站首页>How does VirtualBox set up port forwarding?
How does VirtualBox set up port forwarding?
2022-07-23 10:29:00 【Turn X7】
We are using VirtualBox Software installation Linux After the virtual machine , Install some services in the virtual machine , Such as tomcat etc. , If you want to access the service in the virtual machine on the host , Such as visit 8080 port ,ssh Of 22 Port, etc , How should I access it , What configuration should be done ? Installation is to set up port forwarding .
Method / step
First install virtualbox Software , Then create a new virtual machine , And set up Linux Of ISO Virtual machine image , Then install , Start the virtual machine after installation .

First install Enhancements , Port forwarding can only be carried out based on this enhancement .
If Linux It's the desktop version , Will automatically run the installation ; If there is no desktop , You need to use the command to mount the image , And then do something like VBxxx.run The file of . Restart the virtual machine after successful execution .

If you want to access 22 port , First check openssh-server Installed or not , If not, you need to install it first , Before forwarding 22 port . Use different commands to install according to different systems .

And then in the virtual machine , Add port forwarding in settings , The path is a : Set up -> The Internet -> senior -> Port forwarding , Choice of network connection mode NAT. Be careful The host port cannot be an occupied port .


Finally, verify whether the port in the virtual machine can be accessed in the host . By accessing the specified port in the host , Then forward to the designated forwarding in the virtual machine for access . such as ssh Connecting virtual machines :
$ ssh -l test -p 2222 127.0.0.1
For example, verify whether you can access 8080 port :
$ telnet 127.0.0.1 8080 or nc -z 127.0.0.1 8080

matters needing attention
Pay attention to installing enhancements first , Otherwise it won't work .
ssh Pay attention to inspection when openssh-server Is it installed , If not, you need to install .
The port in the host cannot be occupied .
边栏推荐
- ArcGIS calculates the correlation between two grid layers
- 金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(五))
- 什么是即时通讯?即时通讯的发展
- [vscode] the current working directory is not the current folder /pathlib print CWD path error
- Customer first | domestic Bi leader, smart software completes round C financing
- Kingbasees SQL language reference manual of Jincang database (8. Function (V))
- The world is being devoured by open source software
- Kingbasees SQL language reference manual of Jincang database (8. Function (2))
- 金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(六))
- redis的事务、锁机制、秒杀
猜你喜欢
随机推荐
行业洞察|如何更好地建设数据中台?IT和业务要“齐步走”
What is the difference between College coder and 985 programmer?
Network communication principle and IP address allocation principle. The seven layers of the network are physical layer, data link layer, network layer, transmission layer, session layer, presentation
[c#] IEnumerable可枚举类型接口分析yield
Kingbasees SQL language reference manual of Jincang database (8. Function (2))
MySQL three table query problem
Advantages and disadvantages of RDB and AOF
Redis安装
These four key technologies are necessary to realize the unified management of urban governance through one network
Redis transaction - detailed implementation process of seckill case simulation
32-spark的分区算子介绍、广播变量和累加器
网络数据泄露事件频发,个人隐私信息如何保护?
什么是即时通讯?即时通讯的发展
[vscode] the current working directory is not the current folder /pathlib print CWD path error
Redis token record user login design solution?
使用MindStudio的X2MindSpore工具进行训练脚本转换
金仓数据库 KingbaseES SQL 语言参考手册 (8. 函数(五))
performance介绍
Langue C - quelques exercices classiques de langue C
Reverse theoretical knowledge 1












![[c #] IEnumerable enumerable type interface analysis yield](/img/08/8c346ce257b4adc0bea80bf05b6f52.png)

