我在虚拟机上运行 12.04 LTS。我遇到了一个问题,当点击或调整屏幕大小时,屏幕变黑,熟悉的橙色背景会显示一小会儿。我不得不关闭机器,现在我没有 GUI。我只得到一个黑色的命令行界面。
正如其他一些帖子所建议的那样,我尝试:
sudo service lightdm restart
这对我来说不起作用,因为它卡在了这一点:
Skipping profile in /etc/apparmor.d/disable: user.bin.firefox
Skipping profile in /etc/apparmor.d/disable: user.sbin.rsyslogd
* Starting AppArmor profiles [ OK ]
有任何想法吗?
编辑:/var/log/lightdm/lightdm.log:
[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Starting Light Display Manager 1.2.1, UID=0 PID=933
[+0.00s] DEBUG: Loaded configuration from /etc/lightdm/lightdm.conf
[+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager
[+0.00s] DEBUG: Registered seat module xlocal
[+0.00s] DEBUG: Registered seat module xremote
[+0.00s] DEBUG: Adding default seat
[+0.00s] DEBUG: Starting seat
[+0.00s] DEBUG: Starting new display for greeter
[+0.00s] DEBUG: Starting local X display
[+0.35s] DEBUG: X server :0 will replace Plymouth
[+0.44s] DEBUG: Using VT 7
[+0.44s] DEBUG: Activating VT 7
[+0.44s] DEBUG: Logging to /var/log/lightdm/x-0.log
[+0.64s] DEBUG: Writing X server authority to /var/run/lightdm/root/:0
[+0.64s] DEBUG: Launching X Server
[+0.65s] DEBUG: Launching process 960: /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none
[+0.66s] DEBUG: Waiting for ready signal from X server :0
[+0.66s] DEBUG: Acquired bus name org.freedesktop.DisplayManager
[+0.66s] DEBUG: Registering seat with bus path /org/freedesktop/DisplayManager/Seat0
[+0.70s] DEBUG: Process 960 exited with return value 127
[+0.70s] DEBUG: X server stopped
[+0.70s] DEBUG: Removing X server authority /var/run/lightdm/root/:0
[+0.70s] DEBUG: Releasing VT 7
[+0.70s] DEBUG: Stopping Plymouth, X server failed to start
[+1.34s] DEBUG: Display server stopped
[+1.34s] DEBUG: Stopping display
[+1.34s] DEBUG: Display stopped
[+1.34s] DEBUG: Stopping X local seat, failed to start a display
[+1.34s] DEBUG: Stopping seat
[+1.34s] DEBUG: Seat stopped
[+1.34s] DEBUG: Required seat has stopped
[+1.34s] DEBUG: Stopping display manager
[+1.34s] DEBUG: Display manager stopped
[+1.34s] DEBUG: Stopping daemon
[+1.35s] DEBUG: Exiting with return value 1
答案1
您的 lightdm 日志指出无法启动 X,并且您的 x-0.log 抱怨缺少库。尝试安装libxfont1,但我怀疑您可能遗漏了其他东西。
[+1.34s] DEBUG: Stopping X local seat, failed to start a display
/usr/bin/X: error while loading shared libraries: libXfont.so.1: cannot open shared object file: No such file or directory
安装方法:
sudo apt-get install libxfont1
答案2
启用实验性 Nvidia 驱动程序后,我遇到了这个问题。如果您认为您遇到了同样的问题:
- 在启动时,输入 Ctrl-Alt-F1 以获取命令提示符。
- 检查您是否安装了 nvidia 模块,
lsmod | grep nvidia
如果有输出,则说明您已安装 nvidia,否则这不是适合您的解决方案 - 使用以下命令删除 nvidia 模块
sudo rmmod nvidia
- 使用以下命令重启 lightdm
sudo service lightdm start
- 您很快就应该会看到登录屏幕。如果没有,那么此解决方案对您没有帮助。
- 对我来说,一旦我成功启动,我必须通过设置->附加驱动程序删除所有 nvidia 驱动程序(我安装了所有实验性附加驱动程序)。否则,当我重新启动时,我会遇到同样的问题,并且每次都必须执行上述操作
- 删除所有驱动程序后,我重新启动,没有任何问题。然后我启用了默认的 nvidia 驱动程序,重新启动,一切正常!