Introduction to Linux System Administrator (IV)

Source: Internet
Author: User

Author Li Wanpeng

 

If you want to access the virtual machine on the server, you can use vncviewer to first log in to the server and then operate VMM (virtual machie manager, QEMU). This is troublesome. We can directly log on to the guest OS in a simpler way.

First, add the ssh configuration file to the home directory:

Hacker @ hacker :~ $ Cat. ssh/config
Host 9.186.9.18
User liwp
LocalForward localhost: 4444 192.168.122.156: 22
LocalForward localhost: 6666 FIG: 5902

Here 9.186.9.18 is the server address, liwp is my account on the server, 4444,6666 is the port on my localhost, and 192.168.122.156 is the ip address of the guest OS, 22 is the port used by ssh on the guest OS. 5902 is the VNC server port opened by the VMM. For example:

If the ssh configuration file is successfully added, We can log on.

Two step:

1. log on to the server using ssh

2. In another window:

1) log on to guest OS through the command line

Ssh-p 4444 localhost-l liwp

2) log on to guest OS with vncviewer

Vncviewer localhost: 6666

If you are in the libmongod group, you can use the VMM of localhost to directly run the virtual machine on the remote server instead of running it on the server.

[Liwp @ chinaltcdragon ~] $ Id liwp
Uid = 507 (liwp) gid = 507 (liwp) group = 507 (liwp), 512 (admin), 516 (libvirt)

Three step:

1. admin adds you to the libmongod Group

Usermod-G libvirtd xxxx

2. add connection.

OK! Well done! You can operate your VM on your localhost.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.