如何使用Amazon EC2实例设置桌面GUI?

我需要熟悉一些不能在我的家用机器上运行的软件(windows / mac)。 所以我决定启动一个EC2实例并在那里尝试。

但是,让EC2支持远程桌面会话certificate是比它有权更难。 我尝试了通过networkingsearchfind的技术,但都是过时的,不再相关。

到目前为止,我已经尝试了所有这些build议的解决scheme – 目前还没有工作:

[[email protected] ~]$ yum groups list Loaded plugins: priorities, update-motd, upgrade-helper Installed groups: Editors Legacy UNIX compatibility Mail Server Network Servers Perl Support System Tools Available Groups: Console internet tools DNS Name Server Development Libraries Development tools FTP Server Java Development MySQL Database MySQL Database client NFS file server Networking Tools PHP Support Performance Tools PostgreSQL Database client (version 8) PostgreSQL Database server (version 8) Scientific support TeX support Technical Writing Web Server Web Servlet Engine Done 

没有说这会给我一个X会议。

  • 尝试了一些其他的东西, 例如 :他build议的社区已经不存在了。

  • 也试过这个 :freenx已经不在了,现在没有机器服务器是4.3,似乎没有在免费版本中工作。

  • x2go也失败。

  • 也试过这个 : https : //www.nomachine.com/AR10K00710 。 Xvfb不可用。

有没有人从设置中解决了这个问题,最近才开始工作?

PS有人问为什么不使用一个VirtualBox虚拟机 – 忘了提及,我绝对尝试过,无论是什么原因,他们都没有工作。 我从最近开始,并在每个版本中向后工作 – 无法让他们启动或运行。 (我的机器是Windows 8的Cintiq伴侣)。

从马特的意见后的build议

build立一个SSH隧道加上本地私钥使用这个链接的说明: http : //www.serverwatch.com/server-tutorials/setting-up-vnc-on-ubuntu-in-the-amazon-ec2-page- 2.HTML

在ec2上跑这些安装程序(不知道哪个是过度杀伤 – 只是它最终工作)

 sudo apt-get update sudo apt-get install ubuntu-desktop sudo apt-get install vnc4server sudo apt-get install x11vnc x11vnc -storepasswd sudo apt-get install gnome-core gnome-session-fallback vncserver vncserver -kill :1 #(to get the default xstartup file) 

编辑$ HOME / .vnc / xstartup看起来像这样:

 #!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER #exec /etc/X11/xinit/xinitrc gnome-session --session=gnome-classic & [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & #x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” & #x-window-manager & 

必须为ubuntu用户设置密码(gnome桌面似乎需要这个?)

 sudo passwd ubuntu 

必须重新启动实例

然后跑了

  sudo x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -usepw 

然后我可以通过TightVNC连接并查看Ubuntu桌面

不知道我可能遇到什么其他的麻烦,但至less我得到了这一点

谢谢你,马特

我注意到你说你尝试过X2Go,但是失败了; 我现在在两个Ubuntu 14.04上成功使用它,一个是AWS上的EC2 micro,另一个是一个小的DigitalOcean液滴(它也适用于其他许多发行版,但是您必须修改下面的步骤3在这些指示 )。 虽然VNC肯定会起作用,但是X2go更快,响应速度更快,并且默认支持SSH代理。

我经历了find过时的或不相关的文章和build立云桌面的build议,但是一旦我find了X2Go解决scheme,它实际上很容易在10分钟内启动和运行。

以下是我用来设置一切的步骤:

  1. SSH密钥 – 因为它是一个远程服务器,所以你应该已经能够通过SSH正常login了,但是如果没有的话,你需要通过RSA密钥进行SSHlogin才能使用sudo权限

  2. 系统更新 – 不是必需的,但取决于上次更新远程机器的时间,现在这样做可能会避免不兼容或令人头痛:

     sudo apt-get update sudo apt-get dist-upgrade sudo apt-get autoremove 
  3. 安装X2Go服务器 – 在远程机器上创build一个新文件并粘贴下列内容:

     #!/usr/bin/env bash # note: this script may take some time to run, particularly # the steps involving the install of xubuntu as it has many # packages included as dependencies printf "\ninstalling required packages...\n" sudo apt-get install python-software-properties sudo apt-get install software-properties-common printf "\ninstalling xubuntu...\n" sudo apt-get install xubuntu-desktop printf "\nadding x2go ppa repository...\n" sudo add-apt-repository ppa:x2go/stable sudo apt-get update printf "\ninstalling x2go server...\n" sudo apt-get install x2goserver x2goserver-xsession printf "\nxubuntu and x2go server have been installed.\n" echo "don't forget to reboot your instance as well!" 

    执行该文件以安装所有内容( . ./<filename> ); 你可能需要首先修改文件的权限,使其可执行 – 通常我已经花了5-10分钟,但是,ymmv

  4. 安装X2Go客户端 – 最后一步是为要访问远程机器的操作系统安装客户端; Windows,Mac和各种Linux的安装说明可以在这里find

现在,您可以使用客户端通过您configuration的主机,用户,密钥,端口连接到本机,并访问您的GUI云桌面; 确保在设置连接时selectXFCE作为会话types。

如果您在Amazon实例上使用NoMachine,则应该按照此处的说明进行操作: https ://www.nomachine.com/AR10K00710(无服务器上的NoMachine)

不,你不能。 Amazon Linux没有X服务器软件包的Repo。 此外,这意味着用于服务器端angular色,因此他所有的X相关的东西是不可用的。

谢谢slayedbylucifer

表单https://stackoverflow.com/a/21273694/1105231