通过
sudo apt-get install xfce4-terminal
sudo apt-get install xfce4
sudo service dbus restart
来安装所需要的软件包,期初我也是按部就班的通过网上搜索到的教程进行操作,例如:
sudo nano ~/.bashrc
#在末尾添加
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
export WAYLAND_DISPLAY=$DISPLAY
export XDG_SESSION_TYPE=x11
接着输入
source ~/.bashrc
启动
xfce4-session
或者
startxfce4
基本上网上都是这么写的,但是我发现我这么做根本就不对,不知道是不是我的问题,报错如下:
~$ xfce4-session
Unable to init server: Could not connect: Connection refused
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.
和
startxfce4
/usr/bin/startxfce4: X server already running on display 127.0.0.1:0.0
xrdb: Connection refused
xrdb: Can't open display '127.0.0.1:0.0'
Unable to init server: Could not connect: Connection refused
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.
基本上按照网络上的方法,都会出现这个报错,最后我终于找到了办法,首先在powershell里输入ipconfig
如图:
把这个地址记下来,然后在控制台中输入
vim ~/.bashrc
在末尾只需要添加
export DISPLAY=`cat /etc/resolv.conf | grep nameserver | awk '{print $2}'`:0.0
export DISPLAY=你刚才复制的ip地址:0
即可解决问题