系统:ubuntu 16.04
步骤一:安装图形界面
1.1. 依次在命令行窗口执行以下命令
sudo apt-get update
sudo apt-get install vnc4server
sudo apt-get install xfce4
sudo apt-get install ubuntu-desktop
sudo apt-get install xrdp
1.2. 修改50-unity-greeter.conf文件
cd /usr/share/lightdm/lightdm.conf.d/
sudo vim ./50-unity-greeter.conf
在最后面添加如下内容,
user-session=ubuntu
greeter-show-manual-login=true
all-guest=false
如图
1.3. 修改.profile文件
sudo vim /root/.profile
在.profile文件中,修改最后一行mesg n || true 为 tty -s && mesg n || true,即
# mesg n || true
tty -s && mesg n || true
如图
1.4. 使用图形界面
重启即可,即
sudo reboot now
步骤二:设置自动登录
2.1. 点击在界面右上角的设置图标,选择System Settings…,进入User Accounts
2.2. 按照如下步骤进行
- 在My Account中选择root用户
- 点击右上角的 Unlock,使之变成Lock
- 在Automatic Login中点击OFF,使之变成ON
- 点击右上角的Lock,使之变成Unlock
如图
2.3. 重启即可
sudo reboot now
步骤三:取消休眠模式
3.1. 点击在界面右上角的设置图标,选择System Settings…,进入Brightness & Lock
3.2. 在 Turn screen off when inactive for: 处选择 Never,如图
3.3. 重启即可
sudo reboot now