Article directory
1 Introduction
I remember that when the author first came into contact with computers, it was still in the era of win95/98. At that time, the computer desktop had just entered the graphics, and there were still many problems, such as the blue screen with white characters and thrilling sound effects that were ridiculed countless times, but it was indeed deep. It attracted the author (even though I was playing games at that time), which opened the door of my interest. In the following time, various operating systems have entered the graphical era, and there are fewer and fewer operating systems displayed in black and white characters. It happened that Joe's Apple computer was popular all over the world. In order to experience different graphical interface styles, the author also downloaded and installed an Apple-style desktop simulation package (the Apple at that time was not compatible with intel CPU, and the more important reason was that the Apple at that time could not afford it. computer...), but the consequences are various instabilities and crashes of the Windows system.
Now the graphical interfaces of various operating systems are becoming more and more mature, and the styles are gradually becoming similar. The author installs different operating systems on the eliminated computers, starts up from time to time to experience different styles of operation interfaces, and also installs some special software on different operating systems to play with. Until the emergence of the desktop connection software, the author began to use the desktop connection software to open the desktop of other operating systems on the Windows system for operation. It can be said that the emergence of desktop connection software has saved the author a lot of trouble. With the development of software technology, there have been software combinations that can remotely connect to different operating system desktops in the LAN, which greatly expands the playability. Today, the author will introduce a very distinctive one: use the combination of Cpolar+VNC to realize remote connection to the desktop of other systems.
2. Setup of two interconnected computers
In order to illustrate the operation steps of using VNC interconnection between two different operating systems, the author uses a computer with Ubuntu system installed and a computer with Windows system installed. If you plan to connect computers with other operating systems, you can also refer to these steps.
2.1 Windows installation VNC
Since the computers I usually use are Windows operating systems, I need to use Windows to connect to desktops of other operating systems. First, you need to install VNC on Windows, just visit the VNC official website ( https://www.realvnc.com/en/connect/download/viewer/ ) and download the VNC version for Windows.
After the Windows version of VNC is downloaded, double-click the .exe file and next
complete the installation all the way. During the installation, a prompt box may appear to select the location of the software installation, just select local hard drive
the location.
2.2 Install VNC on Ubuntu
Then install VNC on the operating system that you intend to connect to. Here, you intend to connect to the Ubuntu system, so VNC is installed on the Ubuntu system (other operating systems can be analogized by analogy).
It should be noted that if you want to remotely connect to the Ubuntu graphical desktop, you may need to execute the installation command of the graphical desktop first.
sudo apt install ubuntu-desktop
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
Then enter the command to restart Ubuntu, you can enable the graphical desktop
sudo reboot
In order to better obtain the graphical interface of Ubuntu, you can also choose to install lightDM, enter the command
sudo apt-get install lightdm
You can install lightDM. When asked during the installation, we can press Tab on the keyboard to select light
.
Then enter the command in the Ubuntu command line interface
sudo apt-get install x11vnc
VNC can be installed automatically
After completing the VNC installation, it is best to set VNC to start on boot (after all, no one wants to restart the VNC software every time Ubuntu is restarted). input the command
sudo vim /lib/systemd/system/x11vnc.service
Create a new x11vnc.service file, where vim can be installed by entering the command sudo apt install vim, if vim is not installed, the x11vnc.service file cannot be created, then press the i key to enter the editing mode of the file, and enter the following command:
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /home/<USERNAME>/.vnc/passwd -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
It should be noted that the one shown in blue <USERNAME>
needs to be replaced with the actual username of Ubuntu.
After the command is added, you can enter to :wq
save and exit.
Finally, set it to start on boot
sudo systemctl enable x11vnc.service
start service
sudo systemctl start x11vnc.service
After completing the Ubuntu VNC settings, you can then install Cpolar to prepare for our remote connection to the Ubuntu desktop through VNC
2.3. Install cpolar on Ubuntu
In comparison, installing cpolar on Ubuntu is much simpler, just enter the command:
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
You can automatically install cpolar. If you are a foreign user, you can also use the short link to install:
curl -sL https://git.io/cpolar | sudo bash
After the installation program is completed, you can enter the command cpolar version
to check the version number. As long as the version number can be displayed, it means that cpolar has been successfully installed.
Then, you can visit the official website of cpolar ( www.cpolar.com ) through the browser to register your own account and log in on the official website of cpolar to obtain the token code of the cpolar client to activate the client of cpolar. Of course, the first thing is to register as a cpolar user (cpolar is divided by registration name, generates a separate data channel for each customer, and generates a user's unique token code to ensure data security), and new user registration is also very simple.
After completing the user registration and logging in to the cpolar official website as a registered user, you can see a series of very complicated token codes on the main page of the cpolar website.
We copy this string of token codes, paste them into the Ubuntu command line interface and enter them. The specific commands are:
cpolar authtoken (此处粘贴那串复杂的token码)
After the Token code is entered, it will be automatically written into the configuration file of cpolar. At this point, we can enter localhost:9200 in the Ubuntu browser to open the cpolar Web-UI interface.
After entering the registered user name and password on the login interface, you can enter the main interface of the cpolar client. Here we can operate on the established tunnel, or create a temporary tunnel from here for short-term use.
However, as mentioned above, I don’t want to reset the VNC connection address every day, and the bandwidth required for remote desktop connections is not small, so I directly upgrade Cpolar to the professional package, and the extra fixed TCP and HTTP tunnels , which can be used to publish web pages or other purposes.
3. C polar settings
If you want to use cpolar to generate a data tunnel that can last for a long time, you need to set it up from both the cpolar cloud and the cpolar client. Among them, the cpolar cloud is mainly responsible for generating the entrance of the intranet penetration data tunnel, that is, the address of the public Internet (it can also be regarded as a blank data tunnel); and the cpolar client is to connect the entrance of the data tunnel with the output port of the local software connect them. Therefore, we need to log in to the cpolar cloud first and set up a blank data tunnel.
3.1 Cpolar cloud settings
On the left side of the main interface of the cpolar official website, find and click the "Reserved" button to enter the reserved data tunnel setting page, here is the setting page for creating a personal blank data tunnel (TCP\HTTP\FTP, etc.), this data tunnel A public Internet address can be generated (i.e. the tunnel's public Internet address).
In order to facilitate the creation of data tunnels, it is naturally necessary to enter some simple information, which mainly includes:
- Region – as long as you select the nearest one in the drop-down menu (closer distance can reduce delay);
- Description – This column can be regarded as a remark of the data tunnel, which is convenient for identification;
After the information is set, click 保留
the button on the right to keep this data tunnel and generate a public Internet address.
Here, we need to copy 地址
the contents of the fields to be filled in during the cpolar client setup.
3.2.Cpolar local setting
隧道管理
After completing the setting of the cpolar cloud, we return to the cpolar client, click the button under the left item of the software interface on the cpolar client 创建隧道
, and enter the cpolar local data tunnel creation page. Here, you also need to set several items of information, so that the blank data tunnel generated by the cloud can be connected with the local output port (the free version of cpolar wants to create a data tunnel, the same operation), these contents are mainly:
- Tunnel name - can be regarded as a note of the data tunnel, used to distinguish the application scenarios of different tunnels;
- Protocol —that is, the transmission protocol of the data tunnel, such as web pages, data transmission, device interconnection, etc., choose the TCP protocol here;
- Local address - here you need to fill in the port number of the software (or intranet device), and the port number of VNC is 5900, so fill in 5900 here;
- Port type - that is, the intranet penetration data tunnel type. If you set up a reserved tunnel in the cpolar cloud, you can choose "fixed TCP port"; if it is just > - temporary test, you can choose "random temporary TCP port" (need Note that to fix the TCP port, you need to upgrade cpolar to the professional version and above);
- Reserved TCP address - this field will appear after selecting "Fixed TCP Port", here you must paste the address generated by the cpolar cloud (if you check "Random Temporary TCP Port", this field will not appear field);
After all the settings are filled in, click the button below 创建
to connect the cloud blank data tunnel with the local Ubuntu VNC software, so that the VNC software in other systems can connect to the Ubuntu system desktop.
After the tunnel is successfully created, a VNC software tunnel with a public Internet address and connected to the local Ubuntu system can be generated. This tunnel can be seen on the page 隧道管理
under the item 隧道列表
, and the tunnel can be operated on this page, such as opening, closing, deleting, etc. If you want to modify the information of this data tunnel, you can also find the modification entry on this page.
The public Internet address of this tunnel can be seen 状态
under the item 在线隧道列表
.
4. Public network access test
Now, we have installed VNC on both Windows and Ubuntu, and the data tunnel of cpolar has been successfully established. Next, we can try to use VNC to operate Ubuntu desktop on Windows.
Just open the VNC software on Windows, and click the "New connection" option in the "File" menu in the upper left corner to open the connection page.
On New connection
the page, you need to fill in the public Internet address generated by cpolar on Ubuntu into VNC Server
the field to guide VNC to find the Ubuntu system.
Finally, click "OK" at the bottom of the page and enter the password, you can successfully connect to the desktop of the Ubuntu system from the Windows system, and perform the required operations.
5 Conclusion
So far, we have used the software combination of VNC+cpolar to connect to the desktop of the Ubuntu system from the Windows desktop, which is considered a success. In this operation, the VNC software can be replaced with other desktop interconnection software to adapt to the operating habits of different users. It should be noted that the remote desktop operation consumes a lot of bandwidth. In order to obtain a better operating experience, it is best to use the paid version of the cpolar data tunnel.