How to use Parsec+Zerotier+moon to realize remote computer cloud computer, cloud office, cloud game

Preliminary explanation

​ RD Client can't stream, Sunflower's bandwidth is limited, and it can't play games at the same time. So can I implement a cloud computer by myself to realize cloud games? The answer is of course yes, the following article will introduce
the three solutions of Parsec remote computer, quick jump link

  1. Using IPv6 to Realize Public Network Access to Remote Desktop
  2. How to use Tencent Cloud to achieve intranet penetration
  3. How to use Parsec+Zerotier+moon to realize cloud computer cloud game , the ultimate solution! ! recommended must see

​ This is the ultimate remote desktop method I am currently using. I have written about the realization of Microsoft remote desktop access through IPV6 and the use of frp to achieve intranet penetration . Interested friends can take a look.

​ If you use Parsec, there are mainly the following methods that I know. Here is the fifth method, but how to set each method is explained through this blog. The purpose of writing this blog is also to quickly configure the environment when you change the environment in the future.

sequence Way advantage shortcoming
1 Using Parsec in LAN There is no such troublesome configuration process, just log in to Parsec on both devices Due to geographical restrictions, Parsec cannot be used outside the LAN, which fails to achieve the purpose of cloud computer cloud games
2 Parsec + public network ipv4 No need for cumbersome configuration, Changlian cloud computer It is too difficult to apply for public network ipv4, and the operator does not give it to you. You only need one device with a public network ip.
3 Parsec + public network ipv6 Operators provide dynamic public network ipv6, which can connect to cloud computers and cloud games A router that supports ipv6 is required and ipv6 is turned on. Here are detailed configuration tutorials . It is not applicable to scenarios where the network cannot be modified, such as a campus network. Both devices need to support ipv6
4 Parsec + Zerotier Solved the problem of 6023 in Parsec, etc., and can realize virtual local area network, so as to connect to each other Zerotier's server is located abroad, and the delay is relatively high, usually above 400ms, which cannot provide a smooth experience
5 Parsec + Zerotier+ moon Personally, I think this is the best way without changing the network structure The configuration is cumbersome and requires patience. At the same time, a domestic cloud server is required (because there is a public network ipv4 address in this way), and the bandwidth configuration does not matter. I will introduce it in detail later

Use symbols to explain the following, so that it can be seen more clearly

主控端电脑:A 云服务器:B 被控端电脑:C

1. Register on Parsec official website

​ Parsec official website address: https://parsec.app/ Download, log in and register, all in one go, both the controlled computer C and the control computer A must download. The interface after the software is opened is like this. I have two computers in it, because I have configured them all. Just log in to the same account on the two computers, so you can directly click Connect to connect

insert image description here

You can change some places that can be optimized in the settings:

  1. Settings - NetWork - UPnP open
  2. Settings——Host——BandWidth Limit——50Mbps (choose according to your actual network)

Methods 1, 2, 3, 4, and 5 all need to be set up in this step, but the settings of Parsec for the first three methods have been completed here, and remote operations can be performed.

2. Zerotier registration + configuration

​ Zerotier official website address: https://www.zerotier.com/ Register to download and log in, all in one go, both the controlled computer C and the control computer A must download. This is the page after I log in. What we need to do is to create a virtual network, and at the same time, add each device to this virtual network, put all the devices in the virtual LAN, and naturally connect. The Zerotier method is also officially recommended by Parsec when a direct connection is not possible. This is the official tutorial on the use of zerotier . The official tutorial is more detailed. If you don’t understand what I wrote, I suggest you read the official tutorial. The core purpose of the blog is to build the moon in the third step, not to teach how to use this software.

insert image description here

​ Click Create A Network in the middle to create a new network, click in, give a name in the name, remember the Network ID , don’t close this interface, this is the key, open the Zerotier software on both the master computer A and the controlled computer C, this software has no window, you can only click on the lower right corner—join New Network, enter the Network ID obtained earlier, after entering, agree to the application to join the network on the Zerotier website (it was not closed just now), the same is true for all two You can apply for all devices.

insert image description here

insert image description here

​ When the networks of both devices are joined, we can see if the two networks can be connected! The IP of the LAN is given above, and we can ping it. If the ping fails, one of the possible reasons is that the router has banned ping, or the router has not successfully joined the LAN. You can check in turn

insert image description here

​ It can be seen that I succeeded in pinging. It is worth noting that the delay of the first ping is 353ms, because this is my host found through Zerotier’s official server, and the official server is overseas, so the delay will be high, but the next three delays will be found to be very low. This is because I configured the moon to perform transfer operations, find two hosts through my own server, and then perform p2p transmission. This is the core of this blog! ! ! Only low latency can guarantee the realization of cloud games. Let's start to explain the core part!

3. Realize low latency by building moon transit

Preparation tools:

​ In addition to the master device A, the controlled device C

​ We also need a domestic transit server B, the configuration doesn’t matter, it doesn’t matter whether the bandwidth is 1M or 100M, its function is not to forward your traffic, its function is generally to find the master device A and the controlled device C through this server, no need to search through the overseas server of Zerotier’s official website, similar to the role of a DNS server. Just buy the cheapest server, the one that costs less than 50 yuan a year is enough

3.1 Server Configuration

  • Install Zerotier on server B
curl -s https://install.zerotier.com/ | sudo bash
  • Add server B to the virtual local area network, please replace the four characters of the network ID with the 16-digit ID of the virtual local area network you created before, and don’t forget to agree to join the network on the Zerotier website
zerotier-cli join 网络ID
  • Generate moon.json file
zerotier-idtool initmoon identity.public > moon.json
  • Modify moon.json
vi moon.json # 用vi编辑器修改就好了,进入输入i进如编辑模式,将ip和端口号输入进去之后,按ESC 输入:wq保存退出

"stableEndpoints": ["server B's ip/9993"]

Note: Note that the quotation mark ip is the official ip address of the server, and the port number behind it is the port of the moon. Don’t forget to open the port 9993 in the server provider

  • Generate a signature file. After this step, a file of 000000xxxxxxxxx.moon will be generated. At the same time, download this file to the local, and then use
zerotier-idtool genmoon moon.json
  • Move this file to the moons.d folder, be careful to replace the file name with your own
mkdir moons.d
move 000000xxxxxxxxx.moon moons.d
service zerotier-one restart  # 之后重启服务器端B的Zerotier

3.2 Setting of master control terminal A and controlled terminal B

​ In the installation directory of Zerotier, create a moons.d folder, and copy the previously downloaded file 000000xxxxxxxxxx.moon into it. Both computers must do this.

安装目录处于Windows: C:\ProgramData\ZeroTier\One

​ The next step is very, very critical. In the Windows built-in search, search for services, find Zerotier One in the service, right-click to restart, the master control terminal A and the controlled terminal C must perform this step! ! ! If you don't do this step, you won't be able to join the moon transfer! ! ! So far all steps have been completed

insert image description here

4. Check whether it is successful

​ In the main control terminal A and the controlled terminal C, respectively open the cmd command line input zerotier-cli listpeersto see if it is successfully opened, find the line of moon, and see if there is a -1, if there is, the operation has failed, and check which step of the above steps has a problem. Briefly introduce some concepts

insert image description here

PLANET planet server, Zerotier root server

MOON satellite server, a private root server built by users, plays the role of proxy acceleration

The LEAF network client is each node connected to the network.

​ Let me show you the final rendering. I implemented it using Parsec+Zerotier+moon. This is a delay across two provinces, 15.13ms, which is enough for even playing games, let alone other things. I coded the UID. You can look at the data at the top, it’s still gratifying, the main control terminal A is 1080p, so I turned on 1080p, and you can open as much as you want with the screen resolution of your main control device A.

insert image description here

References:

  1. ZeroTier and moon build domestic intranet penetration http://t.csdn.cn/grYPo
  2. Distance learning (1): Remote networking based on ZeroTier and Moon forwarding node construction http://t.csdn.cn/fPPu1
  3. Use Zerotier to build a Moon server in a private cloud server http://t.csdn.cn/DLEZi

5. Q&A session

Please leave a message if you have any questions, and I will add it to the QA link in time after I receive it

  1. What should I do if the error 6021 or 6023 occurs in Parsec?

​ This means that there is no public network ip, you need to use any method after method 3, 4, 5

  1. What should I do if there is an 800 error in Parsec?

    This is actually more annoying than 6021 or 6023 errors, indicating that you can't even log in to your account. . . . Turn on a hotspot for your computer and log in to your account.

  2. Does the configuration of server B need to be high?

​ No need, server B just acts as a DNS server, and finally the game after we connect is transmitted through peer to peer, that is, P2P, and the traffic of your server B will not be taken

  1. Why is the delay still high according to your configuration?

    If the delay is high, it may be that the moon server is not working. Use the command in the fourth step to see if it is successfully enabled. In addition, the router must be sure to enable the UPnP function! ! ! ! ! Just turn on the side of the main control device

Guess you like

Origin blog.csdn.net/weixin_44904205/article/details/128278202