首页 > 技术文章 > 【阿里云服务器】ECS轻量服务器 Ubuntu图形界面配置

yznnnn 2019-04-01 16:34 原文


1、购买服务器

阿里云的官方网站为:https://www.aliyun.com/

里面有各种套餐,学生建议购买学生云,大概9元每月。

2、修改主机名

  第一次通过浏览器连接会发现用户名是一堆乱码,首先修改root密码:

# sudo passwd
_______________________________________________________
admin@iZwz954fergdge453fe29tdZ:~$ sudo passwd
sudo: unable to resolve host iZwz954fergdge453fe29tdZ
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

  然后修改主机名,然后重启:

# su
# vim /etc/hostname 
# reboot

3、安装图形界面

  更新和升级软件库:(注意:以下操作都要在root用户下进行

# apt-get update
# apt-get upgrade

  安装 VNC :

# apt-get install vnc4server

  启动 VNC 并设置密码:

# vncserver

  安装gnome桌面

# sudo apt-get install x-window-system-core
# sudo apt-get install gdm
# sudo apt-get install ubuntu-desktop
# sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

  修改 VNC 配置文件

# vi ~/.vnc/xstartup
_______________________________________________________
# 修改后的内容为:
#!/bin/sh
# Uncomment the following two lines for normal desktop:
export XKL_XMODMAP_DISABLE=1
 unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset DBUS_SESSION_BUS_ADDRESS
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

  杀掉原桌面进程,生成新会话:

# vncserver -kill :1
# vncserver :1

  开启 VNC 与 Windows的共享复制粘贴

# vncconfig -nowin&

  在Windows下安装 VncViwer

  打开VNC Viewer,然后File->New connection,输入:

VNC Server: 服务器公网IP:1
Name:随便取名

  双击生成的连接并输入密码,即可远程登录服务器图像界面。

4、美化一下终端

# gedit /etc/profile
_______________________________________________________
# 在最后加入
PS1='\[\033[1;31;1m\]\u:\[\033[1;32;1m\]\W\[\033[1;33;1m\]\$\[\033[1;37;1m\]'
_______________________________________________________
# source /etc/profile

# gedit /root/.bashrc
_______________________________________________________
# 在最后加入
source /etc/profile
_______________________________________________________
# source /root/.bashrc


推荐阅读