在Ubuntu子系统中安装桌面程序的方法参考:
windows 10中的ubuntu子系统安装桌面环境的方法(How to install Ubuntu-desktop in windows 10 Subsystem for Linux)https://blog.csdn.net/u011138447/article/details/78262369在依照上述文章安装好后,使用命令ccsm时,出现以下报错:
moss@****-PC:~$ export DISPLAY=lacalhost:0
moss@****-PC:~$ ccsm
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Traceback (most recent call last):
File "/usr/bin/ccsm", line 99, in <module>
import ccm
File "/usr/lib/python3/dist-packages/ccm/__init__.py", line 1, in <module>
from ccm.Conflicts import *
File "/usr/lib/python3/dist-packages/ccm/Conflicts.py", line 25, in <module>
from ccm.Constants import DataDir
File "/usr/lib/python3/dist-packages/ccm/Constants.py", line 29, in <module>
CurrentScreenNum = Gdk.Screen.get_default().get_number()
AttributeError: 'NoneType' object has no attribute 'get_number'
搜索后有说将前一个命令中的localhost改成本机的ip地址就可以了。雀实可以,但是这里说的本机ip地址并不是指使用命令“systeminfo”查看到的网卡地址,而是“127.0.0.1”。修改后可以正常运行:
moss@****-PC:~$ export DISPLAY=127.0.0.1:0
moss@****-PC:~$ ccsm
compizconfig - Info: Backend : ini
compizconfig - Info: Integration : true
compizconfig - Info: Profile : default