I try to start second xsession on Ubuntu 18.04.1 LTS. I switch to tty3: ctrl + alt + F3 then execute the following commands:

export DISPLAY=:2
startx -- :2

but it fails. Logs. What is wrong ? The same method works fine on Ubuntu 16.04.5 LTS.


Your technique with DISPLAY=:2 worked with my computer and I had two Xservers running at once. My Xserver is 1.20.3 so that should still work with your 1.19.6 revision. My computer has an Intel iGPU. Also, I don't have Ubuntu and I use a Linux dist without systemd so that might be different.

I looked at your log and noticed the Xserver shut down after the keyboard section. I compared that with my Xorg.2.log and wonder if there is confusion with the keyboard. Try adding this to the keyboard part of your xorg conf file:

MatchProduct "Logitech HID compliant keyboard"

That should prevent the Xserver from doctoring the Power Button and Sleep Button for example. The keyboard model and layout messages in your log file did not appear in my log file concerning the Power Button and Sleep Button for example and I see where your keyboard is identified as a keyboard, pointer and mouse:

[    42.146] (II) event4  - Logitech HID compliant keyboard: is tagged by udev as: Keyboard Mouse Joystick

Maybe the libinput section "Ignore Duplicates" is removing the keyboard because of the Keyboard/PixArt mouse. Also, I noticed where you had a message from systemd here:

[    42.153] (II) systemd-logind: returning pre-existing fd for /dev/input/event4 13:68

This isn't much of an answer just some clues. The Xserver will terminate without the input devices and I think they are getting removed because of duplicates.

EDIT: Here is my /etc/X11/xorg.conf.d/50-keyboard.conf:

Section "InputClass"
  Identifier "ASUS laptop keyboard"
  MatchIsKeyboard "on"
  MatchProduct "AT Translated Set 2"
  Option "XkbModel" "asus_laptop"
  Option "XkbLayout" "us"
  Option "XkbOptions" "caps:none,terminate:ctrl_alt_bksp"

EDIT2: Now I see where the duplicates for the touchpad are ignored so maybe the mouse is different. Your MatchIsKeyboard is still matching the Power Button and the Sleep Button so that isn't good. I hope you figure out the problem. The rest of your log looks similar to mine for DISPLAY=:2 except the keyboard.

EDIT3: Does your Xorg.2.log still contain these entries?

[    42.142] (II) XINPUT: Adding extended input device "Sleep Button" (type: KEYBOARD, id 8)
[    42.142] (**) Option "xkb_model" "pc105"
[    42.142] (**) Option "xkb_layout" "pl"
[    42.143] (II) event1  - Sleep Button: is tagged by udev as: Keyboard
[    42.143] (II) event1  - Sleep Button: device is a keyboard

That doesn't appear in my Xorg.2.log file. There are many things handled by the libinput Keyboard driver so editing the files in /usr/share/X11/xorg.conf.d might not work properly and would get replaced when upgrading the packages.

Check your log file and see if the Keyboard is getting matched. Now I think the MatchProduct is just a sub-string so just "Logitech" might be better in case "compliant keyboard" doesn't match.

EDIT4: The /usr/share/X11/xorg.conf.d/ files are the system files and you should really put your own config files in /etc/X11/xorg.conf.d and just create the directory if that doesn't exist.

I am not positive that is the cause of your DISPLAY=:2 problem if the normal startx works. I am thinking your Xorg server isn't configured properly and that only becomes a problem when running 2 servers at the same time. Otherwise, I don't see a problem with your Xorg.2.log info.


I now have 4 Xservers running with the same setup and can switch to them with ctrl-alt F7 F8 F9 or F10. I am out of ideas except the following settings might be useful to run different setups on each and maybe experimenting with these settings could get your multiple Xservers running also:

use: X [:<display>] [option]
-a #                   default pointer acceleration (factor)
-ac                    disable access control restrictions
-audit int             set audit trail level
-auth file             select authorization file
-br                    create root window with black background
+bs                    enable any backing store support
-bs                    disable any backing store support
-c                     turns off key-click
c #                    key-click volume (0-100)
-cc int                default color visual class
-nocursor              disable the cursor
-core                  generate core dump on fatal error
-displayfd fd          file descriptor to write display number to when ready to connect
-dpi int               screen resolution in dots per inch
-dpms                  disables VESA DPMS monitor control
-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs
-f #                   bell base (0-100)
-fc string             cursor font
-fn string             default font name
-fp string             default font path
-help                  prints message with these options
+iglx                  Allow creating indirect GLX contexts
-iglx                  Prohibit creating indirect GLX contexts (default)
-I                     ignore all remaining arguments
-ld int                limit data space to N Kb
-lf int                limit number of open files to N
-ls int                limit stack space to N Kb
-nolock                disable the locking mechanism
-maxclients n          set maximum number of clients (power of two)
-nolisten string       don't listen on protocol
-listen string         listen on protocol
-noreset               don't reset after last client exists
-background [none]     create root window with no background
-reset                 reset after last client exists
-p #                   screen-saver pattern duration (minutes)
-pn                    accept failure to listen on all ports
-nopn                  reject failure to listen on all ports
-r                     turns off auto-repeat
r                      turns on auto-repeat 
-render [default|mono|gray|color] set render color alloc policy
-retro                 start with classic stipple and cursor
-s #                   screen-saver timeout (minutes)
-seat string           seat to run on
-t #                   default pointer threshold (pixels/t)
-terminate             terminate at server reset
-to #                  connection time out
-tst                   disable testing extensions
ttyxx                  server started from init on /dev/ttyxx
v                      video blanking for screen-saver
-v                     screen-saver without video blanking
-wm                    WhenMapped default backing-store
-wr                    create root window with white background
-maxbigreqsize         set maximal bigrequest size 
+xinerama              Enable XINERAMA extension
-xinerama              Disable XINERAMA extension
-dumbSched             Disable smart scheduling and threaded input, enable old behavior
-schedInterval int     Set scheduler interval in msec
-sigstop               Enable SIGSTOP based startup
+extension name        Enable extension
-extension name        Disable extension
-query host-name       contact named host for XDMCP
-broadcast             broadcast for XDMCP
-multicast [addr [hops]] IPv6 multicast for XDMCP
-indirect host-name    contact named host for indirect XDMCP
-port port-num         UDP port number to send messages to
-from local-address    specify the local address to connect from
-once                  Terminate server after one session
-class display-class   specify display class to send in manage
-cookie xdm-auth-bits  specify the magic cookie for XDMCP
-displayID display-id  manufacturer display ID for request [+-]accessx [ timeout [ timeout_mask [ feedback [ options_mask] ] ] ] enable/disable accessx key sequences
-ardelay               set XKB autorepeat delay
-arinterval            set XKB autorepeat interval

Device Dependent Usage
-config file           specify a configuration file, relative to the xorg.conf search path, only root can use absolute
-configdir dir         specify a configuration directory, relative to the xorg.conf.d search path, only root can use absolute
-verbose [n]           verbose startup messages
-logverbose [n]        verbose log messages
-quiet                 minimal startup messages
-fbbpp n               set bpp for the framebuffer. Default: 8
-depth n               set colour depth. Default: 8
-gamma f               set gamma value (0.1 < f < 10.0) Default: 1.0
-rgamma f              set gamma value for red phase
-ggamma f              set gamma value for green phase
-bgamma f              set gamma value for blue phase
-weight nnn            set RGB weighting at 16 bpp.  Default: 565
-layout name           specify the ServerLayout section name
-screen name           specify the Screen section name
-keyboard name         specify the core keyboard InputDevice name
-pointer name          specify the core pointer InputDevice name
-nosilk                disable Silken Mouse
-flipPixels            swap default black/white Pixel values
-disableVidMode        disable mode adjustments with xvidtune
-allowNonLocalXvidtune allow xvidtune to be run as a non-local client
-allowMouseOpenFail    start server even if the mouse can't be initialized
-ignoreABI             make module ABI mismatches non-fatal
-isolateDevice bus_id  restrict device resets to bus_id (PCI only)
-version               show the server version
-showDefaultModulePath show the server default module path
-showDefaultLibPath    show the server default library path
-novtswitch            don't automatically switch VT at reset & exit
-sharevts              share VTs with another X server
vtXX                   use the specified VT number
-keeptty               don't detach controlling tty (for debugging only)
-masterfd <fd>         use the specified fd as the DRM master fd (not if setuid/gid)
  • My configuration files are only placed in the following directory: /usr/share/X11/xorg.conf.d/ I added MatchProduct "Logitech HID compliant keyboard" to 40-libinput.conf (I don't have any keyboard.conf file) but it didn't help. – Irbis Dec 30 '18 at 14:33
  • Check my edit above. – beginner6789 Dec 30 '18 at 14:43
  • I changed MatchProduct "Logitech HID compliant keyboard" to MatchProduct "Logitech" as you suggested. Logs look different: pastebin.com/L4Q7pGJ3 but startx still fail. Ubuntu 18.04 uses 2 xservers, here is explanation how GDM works and why: askubuntu.com/questions/910108/… but I'm not sure if GDM uses startx internally. – Irbis Dec 30 '18 at 17:58
  • Did you put that in /etc/X11/xorg.conf.d/ because I think the libinput is different since you changed /usr/share/X11/xorg.conf.d files. Please change those back again and only keep the config file changes in /etc/X11/xorg.conf.d/ directory. I don't have a GDM so don't know what might be the reason. I would think if DISPLAY=:0 works then DISPLAY=:2 would also work. Both servers work at the same time on mine so am running out of ideas why yours doesn't work now. The log still doesn't look right for the input devices. – beginner6789 Dec 30 '18 at 18:49
  • Yes, I put modified 40-libinput.conf in the /etc/X11/xorg.conf.d but it didn't help. – Irbis Dec 31 '18 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.