You are not logged in.
For a display manager I'm developing, I'm experimenting with starting an X server manually, which means actually running the `/usr/bin/X` binary, not using something like `startx`. The issue is that when I run a command like
sudo /usr/bin/X :0 vt02my display is automatically switched to virtual terminal 2, the display is not cleared (no X server applications are started, so I expect to see either the old screen not cleared or a blank screen), and I can no longer access any other virtual terminals. Pressing Ctrl+Alt+F[1-7] no longer works. I have to restart the machine if I want to do anything else.
Is the expected behavior when starting the X server manually? Note that this is after starting the system with no display manager, so no other instance of X is running. Also, after looking at how the Slim display manager does it, it seems it calls something like `/usr/bin/X :0 vt07 -auth /path/to/authfile`, so the only real difference between my command and the command of a real, working display manager is the auth file, which I don't think is the problem here.
Here is the Xorg log from one of my attempts, although I don't see any errors that could indicate what the problem is:
[ 631.692]
X.Org X Server 1.16.3
Release Date: 2014-12-20
[ 631.692] X Protocol Version 11, Revision 0
[ 631.692] Build Operating System: Linux 3.18.1-1-ARCH x86_64
[ 631.692] Current Operating System: Linux arch 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64
[ 631.692] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=5ba710b1-c7b7-410d-baed-d6670f818d56 rw quiet
[ 631.692] Build Date: 29 December 2014 01:09:58PM
[ 631.693]
[ 631.693] Current version of pixman: 0.32.6
[ 631.693] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 631.693] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 631.693] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Jan 3 23:38:54 2015
[ 631.865] (==) Using config directory: "/etc/X11/xorg.conf.d"
[ 631.865] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 631.911] (==) No Layout section. Using the first Screen section.
[ 631.911] (==) No screen section available. Using defaults.
[ 631.911] (**) |-->Screen "Default Screen Section" (0)
[ 631.911] (**) | |-->Monitor "<default monitor>"
[ 631.918] (==) No device specified for screen "Default Screen Section".
Using the first device section listed.
[ 631.918] (**) | |-->Device "Intel Graphics"
[ 631.918] (==) No monitor specified for screen "Default Screen Section".
Using a default monitor configuration.
[ 631.918] (==) Automatically adding devices
[ 631.918] (==) Automatically enabling devices
[ 631.918] (==) Automatically adding GPU devices
[ 631.996] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/OTF/".
[ 631.996] Entry deleted from font path.
[ 631.996] (Run 'mkfontdir' on "/usr/share/fonts/OTF/").
[ 632.040] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[ 632.040] Entry deleted from font path.
[ 632.040] (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
[ 632.040] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[ 632.040] Entry deleted from font path.
[ 632.040] (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
[ 632.040] (==) FontPath set to:
/usr/share/fonts/misc/,
/usr/share/fonts/TTF/,
/usr/share/fonts/Type1/
[ 632.040] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 632.040] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 632.047] (II) Loader magic: 0x818d80
[ 632.047] (II) Module ABI versions:
[ 632.047] X.Org ANSI C Emulation: 0.4
[ 632.047] X.Org Video Driver: 18.0
[ 632.047] X.Org XInput driver : 21.0
[ 632.047] X.Org Server Extension : 8.0
[ 632.051] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c1
[ 632.052] (II) xfree86: Adding drm device (/dev/dri/card1)
[ 632.053] (II) systemd-logind: got fd for /dev/dri/card1 226:1 fd 10 paused 0
[ 632.053] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 632.054] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[ 632.058] (--) PCI:*(0:0:2:0) 8086:0116:103c:185d rev 9, Mem @ 0xc0000000/4194304, 0xb0000000/268435456, I/O @ 0x00006000/64
[ 632.058] (--) PCI: (0:1:0:0) 1002:6760:103c:185d rev 0, Mem @ 0xa0000000/268435456, 0xc6500000/131072, I/O @ 0x00005000/256, BIOS @ 0x????????/131072
[ 632.058] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[ 632.059] (II) LoadModule: "glx"
[ 632.097] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 632.114] (II) Module glx: vendor="X.Org Foundation"
[ 632.114] compiled for 1.16.3, module version = 1.0.0
[ 632.114] ABI class: X.Org Server Extension, version 8.0
[ 632.114] (==) AIGLX enabled
[ 632.114] (II) LoadModule: "intel"
[ 632.114] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
[ 632.161] (II) Module intel: vendor="X.Org Foundation"
[ 632.161] compiled for 1.16.3, module version = 2.99.917
[ 632.161] Module class: X.Org Video Driver
[ 632.161] ABI class: X.Org Video Driver, version 18.0
[ 632.161] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[ 632.162] (II) intel: Driver for Intel(R) HD Graphics: 2000-6000
[ 632.162] (II) intel: Driver for Intel(R) Iris(TM) Graphics: 5100, 6100
[ 632.162] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics: 5200, 6200, P6300
[ 632.162] (++) using VT number 2
[ 632.177] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20140725
[ 632.184] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 3000
[ 632.184] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx
[ 632.184] (II) intel(0): Creating default Display subsection in Screen section
"Default Screen Section" for depth/fbbpp 24/32
[ 632.184] (==) intel(0): Depth 24, (--) framebuffer bpp 32
[ 632.184] (==) intel(0): RGB weight 888
[ 632.184] (==) intel(0): Default visual is TrueColor
[ 632.184] (**) intel(0): Option "AccelMethod" "sna"
[ 632.184] (**) intel(0): Option "Backlight" "intel_backlight"
[ 632.184] (II) intel(0): Output LVDS1 has no monitor section
[ 632.184] (**) intel(0): Found backlight control interface intel_backlight (type 'raw') for output LVDS1
[ 632.184] (II) intel(0): Enabled output LVDS1
[ 632.185] (II) intel(0): Output VGA1 has no monitor section
[ 632.185] (II) intel(0): Enabled output VGA1
[ 632.185] (II) intel(0): Output HDMI1 has no monitor section
[ 632.185] (II) intel(0): Enabled output HDMI1
[ 632.185] (II) intel(0): Output DP1 has no monitor section
[ 632.185] (II) intel(0): Enabled output DP1
[ 632.185] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
[ 632.185] (II) intel(0): Output VIRTUAL1 has no monitor section
[ 632.185] (II) intel(0): Enabled output VIRTUAL1
[ 632.185] (--) intel(0): Output LVDS1 using initial mode 1366x768 on pipe 0
[ 632.185] (--) intel(0): Output HDMI1 using initial mode 1920x1080 on pipe 1
[ 632.185] (==) intel(0): TearFree disabled
[ 632.185] (==) intel(0): DPI set to (96, 96)
[ 632.185] (II) Loading sub module "dri2"
[ 632.185] (II) LoadModule: "dri2"
[ 632.185] (II) Module "dri2" already built-in
[ 632.185] (II) Loading sub module "present"
[ 632.185] (II) LoadModule: "present"
[ 632.185] (II) Module "present" already built-in
[ 632.185] (==) Depth 24 pixmap format is 32 bpp
[ 632.201] (II) intel(0): SNA initialized with Sandybridge (gen6, gt2) backend
[ 632.201] (==) intel(0): Backing store enabled
[ 632.201] (==) intel(0): Silken mouse enabled
[ 632.202] (II) intel(0): HW Cursor enabled
[ 632.202] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[ 632.204] (==) intel(0): DPMS enabled
[ 632.204] (==) intel(0): display hotplug detection enabled
[ 632.204] (II) intel(0): [DRI2] Setup complete
[ 632.204] (II) intel(0): [DRI2] DRI driver: i965
[ 632.204] (II) intel(0): [DRI2] VDPAU driver: i965
[ 632.204] (II) intel(0): direct rendering: DRI2 enabled
[ 632.204] (II) intel(0): hardware support for Present enabled
[ 632.204] (--) RandR disabled
[ 632.390] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[ 632.390] (II) AIGLX: enabled GLX_ARB_create_context
[ 632.390] (II) AIGLX: enabled GLX_ARB_create_context_profile
[ 632.390] (II) AIGLX: enabled GLX_EXT_create_context_es2_profile
[ 632.390] (II) AIGLX: enabled GLX_INTEL_swap_event
[ 632.390] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[ 632.390] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[ 632.390] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[ 632.390] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[ 632.390] (II) AIGLX: enabled GLX_ARB_create_context_robustness
[ 632.391] (II) AIGLX: Loaded and initialized i965
[ 632.391] (II) GLX: Initialized DRI2 GL provider for screen 0
[ 632.405] (II) intel(0): switch to mode 1366x768@60.0 on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 632.407] (EE) intel(0): failed to set mode: Permission denied [13]
[ 632.408] (II) intel(0): switch to mode 1920x1080@60.0 on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
[ 632.413] (EE) intel(0): failed to set mode: Permission denied [13]
[ 632.413] (WW) intel(0): failed to restore desired modes on VT switch
[ 632.413] (EE) intel(0): sna_mode_check: invalid state found on pipe 0, disabling CRTC:7
[ 632.413] (EE) intel(0): sna_mode_check: invalid state found on pipe 1, disabling CRTC:11
[ 632.769] (II) config/udev: Adding input device Power Button (/dev/input/event4)
[ 632.769] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 632.769] (II) LoadModule: "evdev"
[ 632.813] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 632.876] (II) Module evdev: vendor="X.Org Foundation"
[ 632.876] compiled for 1.16.2, module version = 2.9.1
[ 632.876] Module class: X.Org XInput Driver
[ 632.876] ABI class: X.Org XInput driver, version 21.0
[ 632.878] (II) systemd-logind: got fd for /dev/input/event4 13:68 fd 18 paused 1
[ 632.878] (II) systemd-logind: releasing fd for 13:68
[ 632.904] (II) config/udev: Adding input device Video Bus (/dev/input/event16)
[ 632.904] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
[ 632.905] (II) systemd-logind: got fd for /dev/input/event16 13:80 fd 18 paused 1
[ 632.905] (II) systemd-logind: releasing fd for 13:80
[ 632.930] (II) config/udev: Adding input device Lid Switch (/dev/input/event1)
[ 632.931] (II) No input driver specified, ignoring this device.
[ 632.931] (II) This device may have been added with another device file.
[ 632.931] (II) config/udev: Adding input device Video Bus (/dev/input/event11)
[ 632.931] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
[ 632.933] (II) systemd-logind: got fd for /dev/input/event11 13:75 fd 18 paused 1
[ 632.933] (II) systemd-logind: releasing fd for 13:75
[ 632.955] (II) config/udev: Adding input device Power Button (/dev/input/event3)
[ 632.955] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[ 632.956] (II) systemd-logind: got fd for /dev/input/event3 13:67 fd 18 paused 1
[ 632.956] (II) systemd-logind: releasing fd for 13:67
[ 632.984] (II) config/udev: Adding input device HDA Digital PCBeep (/dev/input/event6)
[ 632.984] (II) No input driver specified, ignoring this device.
[ 632.984] (II) This device may have been added with another device file.
[ 632.985] (II) config/udev: Adding input device HDA Intel PCH Front Headphone (/dev/input/event8)
[ 632.985] (II) No input driver specified, ignoring this device.
[ 632.985] (II) This device may have been added with another device file.
[ 632.985] (II) config/udev: Adding input device HDA Intel PCH HDMI/DP,pcm=3 (/dev/input/event9)
[ 632.985] (II) No input driver specified, ignoring this device.
[ 632.985] (II) This device may have been added with another device file.
[ 632.986] (II) config/udev: Adding input device HDA Intel PCH Mic (/dev/input/event7)
[ 632.986] (II) No input driver specified, ignoring this device.
[ 632.986] (II) This device may have been added with another device file.
[ 632.986] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event13)
[ 632.986] (**) Logitech USB Receiver: Applying InputClass "evdev pointer catchall"
[ 632.988] (II) systemd-logind: got fd for /dev/input/event13 13:77 fd 18 paused 1
[ 632.988] (II) systemd-logind: releasing fd for 13:77
[ 633.048] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/mouse1)
[ 633.048] (II) No input driver specified, ignoring this device.
[ 633.048] (II) This device may have been added with another device file.
[ 633.049] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event14)
[ 633.049] (**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
[ 633.050] (II) systemd-logind: got fd for /dev/input/event14 13:78 fd 18 paused 1
[ 633.050] (II) systemd-logind: releasing fd for 13:78
[ 633.104] (II) config/udev: Adding input device Microsft Microsoft Wireless Desktop Receiver 3.1 (/dev/input/event12)
[ 633.104] (**) Microsft Microsoft Wireless Desktop Receiver 3.1: Applying InputClass "evdev keyboard catchall"
[ 633.105] (II) systemd-logind: got fd for /dev/input/event12 13:76 fd 18 paused 1
[ 633.105] (II) systemd-logind: releasing fd for 13:76
[ 633.160] (II) config/udev: Adding input device Microsft Microsoft Wireless Desktop Receiver 3.1 (/dev/input/event15)
[ 633.161] (**) Microsft Microsoft Wireless Desktop Receiver 3.1: Applying InputClass "evdev pointer catchall"
[ 633.161] (**) Microsft Microsoft Wireless Desktop Receiver 3.1: Applying InputClass "evdev keyboard catchall"
[ 633.162] (II) systemd-logind: got fd for /dev/input/event15 13:79 fd 18 paused 1
[ 633.162] (II) systemd-logind: releasing fd for 13:79
[ 633.224] (II) config/udev: Adding input device Microsft Microsoft Wireless Desktop Receiver 3.1 (/dev/input/mouse2)
[ 633.224] (II) No input driver specified, ignoring this device.
[ 633.224] (II) This device may have been added with another device file.
[ 633.224] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0)
[ 633.224] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"
[ 633.226] (II) systemd-logind: got fd for /dev/input/event0 13:64 fd 18 paused 1
[ 633.226] (II) systemd-logind: releasing fd for 13:64
[ 633.290] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event10)
[ 633.290] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"
[ 633.290] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"
[ 633.290] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "Default clickpad buttons"
[ 633.290] (II) LoadModule: "synaptics"
[ 633.291] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
[ 633.346] (II) Module synaptics: vendor="X.Org Foundation"
[ 633.346] compiled for 1.16.0, module version = 1.8.1
[ 633.346] Module class: X.Org XInput Driver
[ 633.346] ABI class: X.Org XInput driver, version 21.0
[ 633.348] (II) systemd-logind: got fd for /dev/input/event10 13:74 fd 18 paused 1
[ 633.348] (II) systemd-logind: releasing fd for 13:74
[ 633.397] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/mouse0)
[ 633.397] (**) SynPS/2 Synaptics TouchPad: Ignoring device from InputClass "touchpad ignore duplicates"
[ 633.397] (II) config/udev: Adding input device ST LIS3LV02DL Accelerometer (/dev/input/event2)
[ 633.397] (II) No input driver specified, ignoring this device.
[ 633.397] (II) This device may have been added with another device file.
[ 633.398] (II) config/udev: Adding input device ST LIS3LV02DL Accelerometer (/dev/input/js0)
[ 633.398] (II) No input driver specified, ignoring this device.
[ 633.398] (II) This device may have been added with another device file.
[ 633.399] (II) config/udev: Adding input device HP WMI hotkeys (/dev/input/event5)
[ 633.399] (**) HP WMI hotkeys: Applying InputClass "evdev keyboard catchall"
[ 633.400] (II) systemd-logind: got fd for /dev/input/event5 13:69 fd 18 paused 1
[ 633.400] (II) systemd-logind: releasing fd for 13:69Offline
In my case, I can't switch back to VT, nvidia proprietary driver holds the GPU, then no way back.
You've i965 and some error
[ 632.413] (EE) intel(0): failed to set mode: Permission denied [13]
[ 632.413] (WW) intel(0): failed to restore desired modes on VT switch
Try to inquire your video card and kernel compatibilities. If is not compatible you don't have chances, like mine.
BTW
$ lspci -vnn |grep VGAdo it good first, it will be faster than do it twice the saint ![]()
Offline
Well there has to be a solution regardless of the graphics card, because every display manager I've ever tried lets you access these virtual terminals. In fact, if you run `ps aux | grep X`, you can see the command your current display manager is running. If I run that (minus the auth part), I run into the same issue. Can anyone confirm this or give me a command where they don't run into this issue?
Offline
so the only real difference between my command and the command of a real, working display manager is the auth file, which I don't think is the problem here.
If you run the command WITH the --auth part, does VT switching work ?
Does it make a difference if you run the command without --auth on the same vt you want X to use, or on another vt ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Based on the use of the --auth flag I assumed it wouldn't make a difference, and after trying it, it doesn't make a difference.
This issue happens regardless of the VT I try to run X on.
I'm still wondering if this is only affecting me though. One person has claimed he can't switch VTs either, but is this working as expected for everyone else (if you're going to try it, make sure you've saved anything you're working on in case you have to reboot)?
Offline
Two people so far have tried this for me, and it worked fine for both of them. However, they weren't running Arch Linux, and their versions for Xorg were 1.14 and 1.15, not 1.16 like I have.
It would be really helpful if more people who were using Arch Linux could try this for me, so I could see whether or not this is specific to Arch Linux/Xorg 1.16.
Offline
I tried to test it, but found i couldn't use sudo to execute X .
If i test with runing /usr/bin/X as normal user, tty switching works fine .
Is there a reason you use sudo to start X ?
Archlinux does not have sudo in the base group, so users need to install it themselves (you can workaround this by adding sudo as a dependency ).
However the default /etc/sudoers file that is installed has everything commented out, so there will be some manual configuration needed.
Last edited by Lone_Wolf (2015-01-07 10:35:05)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
I tried to test it, but found i couldn't use sudo to execute X .
If i test with runing /usr/bin/X as normal user, tty switching works fine .Is there a reason you use sudo to start X ?
Archlinux does not have sudo in the base group, so users need to install it themselves (you can workaround this by adding sudo as a dependency ).
However the default /etc/sudoers file that is installed has everything commented out, so there will be some manual configuration needed.
Whoa. When I ran the command without sudo such that `vtXX` was a virtual terminal I wasn't currently on, it failed with "Cannot open virtual console 3 (Permission denied)". However, that was because I actually need to log in to the VT first. After logging in, the error when starting without sudo on a different VT was "VT_ACTIVATE failed: Operation not permitted". However, when I set the VT to be the same one I was currently using, it worked fine.
I then tried again with sudo using the VT I was currently on, and it worked. So the whole issue seems (on my machine at least) to be that you can't start an X server on another VT, only the one you're currently on (or at least, you can start one, but then you're stuck). This seems strange to me, it might be worth reporting as a bug.
Did you also set the VT to be same one you were currently using when you ran the command?
Offline
It works fine here with or without sudo - but yes, X needs to run on the current tty.
Check out existing display managers to see how they first log in to the tty (e.g. using pam) before running X on it.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
It works fine here with or without sudo - but yes, X needs to run on the current tty.
Do you know why? If that's the case, it shouldn't even be allowed to start it on another tty. I wasted a bunch of time because of it.
Check out existing display managers to see how they first log in to the tty (e.g. using pam) before running X on it.
Thanks, but I already got that part working
Ironically the X server stuff has taken more time, but hopefully now I can finish that up.
I'll mark this thread as solved in a day or two if I everything ends up working out.
Offline
https://www.archlinux.org/news/xorg-ser … available/
If you've already set up pam or a similar process to log in to the other tty, then all you need is to chvt[1] before exec'ing X.
[1] example: http://pastebin.com/raw.php?i=f7ycYyxe
Last edited by Trilby (2015-01-07 20:57:44)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
looks like we found the reason for the different behaviour then : xorg-server 1.16 AND systemd-logind .
I don't boot with systemd > logind doesn't work unless system is booted with systemd as init > X 1.16 behaves just like X pre-1.16 on my system
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline