Linux Desktop - yenbohuang/techNotes GitHub Wiki

Ubuntu

Install desktop environments

# KDE, from large to small disk sizes
sudo apt install kde-full
sudo apt-get install kde-standard
sudo apt install kde-plasma-desktop

# Xfce4
sudo apt install xfce4-session xfce4-panel

Install xrdp

sudo apt install xrdp
sudo adduser xrdp ssl-cert

# switch desktop environment, logout, and login again
sudo update-alternatives --config x-session-manager

If x-session-manager does not work, create ".xession" manually.

# For Xfce
echo xfce4-session > .xsession

# For Gnome Flashback Metacity
# echo "gnome-session --session=gnome-flashback-metacity --disable-acceleration-check & gnome-panel" > .xsession

sudo service xrdp restart

If everything looks small in remote desktop:

  • Right Click -> Applications -> Settings -> Appearance
  • Change "Windows Scaling" to "2X" under "Settings" tab.

Follow these blog posts and fix black screen by editing /etc/xrdp/startwm.sh:

See the followings for details:

Switch to GNOME from Unity

  • Install GNOME
  • Choose session when login

See details on http://askubuntu.com/questions/450294/how-to-switch-from-unity-to-gnome

Cent OS

Switch Desktop Environments

Logout and choose the desktop environment by "options icon" before you login CentOS 7.

See details on http://unix.stackexchange.com/questions/181503/how-to-install-desktop-environments-on-centos-7

Install GNOME desktop to CentOS console-only image

Install minimal required packages:

sudo yum groupinstall "X Window System"
sudo yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

Or, install full desktop packages:

sudo yum groups install "GNOME Desktop"

Set default target to desktop environment.

sudo systemctl set-default graphical.target

If this command is not supported, edit /etc/inittab:

id:5:initdefault:

Shutdown VM.

Setting VM by VirtualBox Manager:

  • Add optical drive in "Storage".
  • Set "Shared Clipboard" to "Bidirectional" in "General -> Advanced".

Start VM.

Insert guest additions CD image.

Install VirtualBox addon. If this process failed due to missing packages, install pre-required packages for VirtualBox addons. Kernel version may very depending on OS versions.

sudo yum install kernel-devel-3.10.0-327.el7.x86_64
sudo yum install gcc

Restart VM.

See https://www.centos.org/forums/viewtopic.php?t=47088 for details.

Enable xfce for xRDP

  • Create ~/.Xclients with the following content:
#!/bin/bash
XFCE="$(which xfce4-session 2>/dev/null)"
exec "$XFCE"
  • Make it executable and restart xRDP.
chmod 755 ~/.Xclients
sudo service xrdp restart

See https://www.centos.org/forums/viewtopic.php?t=51046 for details.

Reuse the same session

echo xfce4-session > .xsession
sudo service xrdp restart

See http://c-nergy.be/blog/?p=6046 for details.