如何设置界面在Amazon EC2 Ubuntu的服务器 [英] How To Set Up GUI On Amazon EC2 Ubuntu server

查看:1098
本文介绍了如何设置界面在Amazon EC2 Ubuntu的服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Ubuntu的亚马逊EC2实例,它只能有一个命令行界面。我想设置UI该服务器使用远程桌面工具访问。有什么办法申请GUI来EC2实例?

I'm using an amazon Ubuntu EC2 instance which is only has a command line interface. I want to setup UI for that server to access using remote desktop tools. Is there any way to apply GUI to the EC2 instance?

推荐答案

这是可以做到。下面是步骤设置在GUI

This can be done. Following are the steps to setup the GUI

sudo useradd -m awsgui
sudo passwd awsgui
sudo usermod -aG admin awsgui

sudo vim /etc/ssh/sshd_config # edit line "PasswordAuthentication" to yes

sudo /etc/init.d/ssh restart

设置为主界面的Ubuntu机器在AWS上。

在安全组开放端口5901则SSH服务器实例。运行下面的命令来安装用户界面和VNC服务器:

Setting up ui based ubuntu machine on AWS.

In security group open port 5901. Then ssh to the server instance. Run following commands to install ui and vnc server:

sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo apt-get install vnc4server

然后运行以下命令,然后输入登录密码为VNC连接:

Then run following commands and enter the login password for vnc connection:

vncserver

vncserver -kill :1

vim awsgui/.vnc/xstartup

然后击中了Insert键,左右滚动使用键盘箭头的文本文件,然后从下这行两行的开头删除英镑符号(#) 取消以下两行正常的桌面。而在第二行加上sh的太行读

Then hit the Insert key, scroll around the text file with the keyboard arrows, and delete the pound (#) sign from the beginning of the two lines under the line that says "Uncomment the following two lines for normal desktop." And on the second line add "sh" so the line reads

exec sh /etc/X11/xinit/xinitrc. 

当您完成后,按Ctrl + C键盘上,键入:WQ并按下回车键

When you're done, hit Ctrl + C on the keyboard, type :wq and hit Enter.

然后再启动VNC服务器。

Then start vnc server again.

vncserver

在VNC客户端,给公共DNS加1(如www.example.com:1)。输入VNC登录密码。确保使用正常的连接。不要使用密钥文件。

In the vnc client, give public DNS plus ":1" (e.g. www.example.com:1). Enter the vnc login password. Make sure to use a normal connection. Don't use the key files.

附加指南可在这里:<一href="http://www.serverwatch.com/server-tutorials/setting-up-vnc-on-ubuntu-in-the-amazon-ec2-Page-3.html">http://www.serverwatch.com/server-tutorials/setting-up-vnc-on-ubuntu-in-the-amazon-ec2-Page-3.html

Mac的VNC客户端可以从这里下载/

Mac VNC client can be downloaded from here: http://www.realvnc.com/download/get/1286/

这篇关于如何设置界面在Amazon EC2 Ubuntu的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆