如何在没有监视器的情况下使用 gui 启动 linux?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9699992/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to start linux with gui without monitor?
提问by smarthand
I met a problem. I had a server which is installed redhat enterprise 5.5. And one Qt program was running on this server. So what I should do is to turn on my server, the server will start automaticly with Gui and that Qt program will start automaticly. I finished all on my desktop. But while I start this server without monitor, we know server was running without monitor,the X server go bad.God, what should I do?
我遇到了一个问题。我有一台安装了 redhat Enterprise 5.5 的服务器。一个 Qt 程序正在这台服务器上运行。所以我应该做的是打开我的服务器,服务器会自动启动 Gui 并且 Qt 程序会自动启动。我在桌面上完成了所有操作。但是当我在没有监视器的情况下启动这台服务器时,我们知道服务器在没有监视器的情况下运行,X 服务器坏了。上帝,我该怎么办?
Here is the xorg log:
这是 xorg 日志:
[root@localhost grub]# tail -n 30 /var/log/Xorg.0.log
ABI class: X.Org Video Driver, version 1.0
(II) Loading sub module "i2c"
(II) LoadModule: "i2c"
(II) Loading /usr/lib/xorg/modules/libi2c.so
(II) Module i2c: vendor="X.Org Foundation"
compiled for 7.1.1, module version = 1.2.0
ABI class: X.Org Video Driver, version 1.0
(II) intel(0): Output VGA has no monitor section
(II) intel(0): I2C bus "CRTDDC_A" initialized.
(II) intel(0): EDID for output VGA
(II) intel(0): Output VGA disconnected
(WW) intel(0): No outputs definitely connected, trying again...
(II) intel(0): Output VGA disconnected
(WW) intel(0): Unable to find initial modes
(EE) intel(0): No valid modes.
(II) UnloadModule: "intel"
(II) UnloadModule: "i2c"
(II) Unloading /usr/lib/xorg/modules/libi2c.so
(II) UnloadModule: "ddc"
(II) Unloading /usr/lib/xorg/modules/libddc.so
(II) UnloadModule: "vgahw"
(II) Unloading /usr/lib/xorg/modules/libvgahw.so
(II) UnloadModule: "vbe"
(II) Unloading /usr/lib/xorg/modules/libvbe.so
(II) UnloadModule: "int10"
(II) Unloading /usr/lib/xorg/modules/libint10.so
(EE) Screen(s) found, but none have a usable configuration.
Fatal server error:
no screens found
I searched on internet,somebody told me that I should add nomodeset in the end of the kernel line in /boot/grub/grub.conf.I did it but nothing changed. Can anybody tell me what should I do?
我在互联网上搜索,有人告诉我应该在 /boot/grub/grub.conf 的内核行末尾添加 nomodeset。我做到了,但没有任何改变。谁能告诉我我该怎么办?
采纳答案by Aaron Digulla
Your problem is that the X server checks whether there is really a monitor attached. Your options:
您的问题是 X 服务器检查是否真的连接了监视器。您的选择:
Attach a monitor. Simple but wasteful.
Use Xvnc instead. This is like X but it renders to memory, so it doesn't need a graphics card (and no drivers) and no monitor. You can even connect to it remotely via the VNC protocol.
连接显示器。简单但很浪费。
请改用 Xvnc。这与 X 类似,但它渲染到内存,因此它不需要图形卡(也不需要驱动程序)和显示器。您甚至可以通过 VNC 协议远程连接到它。
The second option is actually pretty simple to implement: Just call vncserver :42
第二个选项实际上很容易实现:只需调用 vncserver :42
After export DISPLAY=:42
, you can run your Qt application and it will connect to the virtual Xvnc server running on the virtual display 42 (0 is the default).
之后export DISPLAY=:42
,您可以运行 Qt 应用程序,它将连接到在虚拟显示器 42 上运行的虚拟 Xvnc 服务器(默认值为 0)。
回答by Lie Ryan
Restart the X server, open a tty window (alt + f1) or (alt+f2) then login on the terminal and run 'startx'. Otherwise try ssh-ing to the server and either attempt startx or reboot the machine.
重新启动 X 服务器,打开 tty 窗口 (alt + f1) 或 (alt+f2) 然后登录终端并运行“startx”。否则,尝试通过 ssh-ing 连接到服务器,然后尝试使用 startx 或重新启动机器。