Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: x11 ?

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    x11 ?

    I know the booting process of linux
    1) grub boots the kernel
    2) kernel does its thing (... creates device files , mounts HDD , loads modules, detects hardware ,..etc) and then creates the init process (the parent of all process that is responsible for creating all other process....)
    3) init then creates all the process in the init and init.d directories on startup ( which executes a login shell ,...etc)
    4) I login and start a gui /x11/gnome desktop enviorment or login and just use the console with no gui enviorment.

    When I login I have the ability to start a desktop session like gnome or kde ,...etc by using startx , kdestart ,...etc

    I am wondering if their is way to start the x11 service but not a desktop session.

    I would like to start just x11 and execute a gui program I made using just the console (no -gui enviorment ) and have it show up without a desktop session/manager.

    The reason why is I want to know how to code my own desktop session/manager like gnome that runs on x11. (obviously not anywhere near as good)

  2. #2
    Linux Engineer
    Join Date
    Jan 2005
    Saint Paul, MN
    If you stay in console mode, check your default run level. If it is at 5, then you are missing a piece of software one of xdm, gdm, or kdm (these provide the gui login.) If your default run level is 3, you need to change it to 5. (of course this is assuming that you are not running Gentoo.) Please check with your distro documentation on how to change the default "run level".

  3. #3
    Linux Newbie BoDiddley's Avatar
    Join Date
    Oct 2010
    Plainfield, New Jersey
    Or if you are really brave uninstall your desktop. I did an install without a desktop.... eventually loaded LXDE.

  4. $spacer_open
  5. #4
    Well , I had the pleasure of an expert X11 guy show me how to do somethings in depth.

    Yes you can uninstall but it is not necessary just kill the desktop and x11 process's .
    Then login in a console say with ctrl + alt + f1
    create a .xinit.rc file in your home directory.
    Then start just the x11 server using xinit.

    If nothing is in the xinit.rc file then no desktop manager and not even a windows manager is loaded. (i.e if you switch back to gui mode ctrl + alt + f7 all you will see is a black screen)
    if you want to run a program using just x11 nothing else then just add your program to the xinit.rc
    as exec "your gui program "

    This is cool since you can start just a firefox browser and a terminal with no windows manager or desktop manager. Or you can start just a windows manager the possiblities are endless.

    One thing I didn't have time to ask him do their exist alternatives to using x11 or does everything run on that (i,e all desktop managers , windows managers ,...etc for linux/unix run on x11) Cann't find out if their is any alternatives.
    This is more just curiosity since x11 is fine for me.

    Also I am curious about how the x11 , desktop mangers/windows mangers , etc get started.
    I know init starts all the top level process's .
    But is xinit started by init or are their other process executed between init and xinit that deal with the x11 system/desktop mangers ,..etc?

  6. #5
    No, xinit is not started by init (see caveat below) but rather your login shell is spawned from init via configuration in /etc/inittab.

    The caveat is situations where you want to automatically start a login manager in, say, run mode 5. Then you can spawn it directly from /etc/inittab. Or you could spawn sulogin and create a shell profile for root to automatically start X (Puppy Linux does something like this). Or you can create a startup script in /etc/rc.d/init.d and link it into the run directory for whatever runlevel you want to start it from (for runlevel 5 it would usually be /etc/rc.d/rc5.d) in which case it gets started by the system startup scripts, which are spawned by init.

    Some distros use a startup script for login managers, while some spawn them directly using inittab. There are benefits and drawbacks to both methods.

    This is all assuming your distro uses traditional sysvinit. Some are switching to more modern booting systems.

  7. #6
    Linux Newbie BoDiddley's Avatar
    Join Date
    Oct 2010
    Plainfield, New Jersey
    Wikipedia seems to indicate otherwise:

    "X is often used in conjunction with an X session manager to implement sessions. Usually, a session is started by the X display manager. However, the user can also start a session by manually running the xinit or startx programs."

    It further states:

    "X does not mandate that the user interface be present — individual client programs known as window managers handle this. The window manager is not necessary and programs may use X's graphical abilities with no user interface."

    This is quite the progressive project. You have given me the motivation I was looking for to continue reading my beginners programming book. I hate reading, prefer to jump right in and execute - but then again this is why I left Windows.

    In order to fully ratify my intent - education will be required. (my version of education anyway - which is not institutionalized).

  8. #7
    Quote Originally Posted by BoDiddley View Post
    Wikipedia seems to indicate otherwise:

    "X is often used in conjunction with an X session manager to implement sessions. Usually, a session is started by the X display manager. However, the user can also start a session by manually running the xinit or startx programs."
    That's not necessarily indicating otherwise. I was describing how the session manager gets started in parts of my post.
    The caveat is situations where you want to automatically start a login manager in, say, run mode 5.
    And session managers can and are started in both of the ways I wen on to describe.

    Do be careful with wikipedia by the way. It may be good for getting the broad strokes, but sometimes even those don't make much sense to you without further reading. For instance:
    programs may use X's graphical abilities with no user interface
    That could be worded a lot better. And I'm not even sure it's correct as written. While it's true that programs can run headless, and it's also true that some cli programs (eg Midnight Commander) link against the X libraries, in order to be displaying anything other than text there normally has to be an X server running. Maybe they mean "no Desktop Environment?" Hard to say.

  9. #8
    question 1
    What is all the process's and scripts that init calls on booting my linux machine. Is their someway of finding out or printing and pauseing what is being executed by init at bootup.
    (i.e all the scripts , programs , and process it starts/executed)
    As a side note: When does init exec xinit or call a script to do it...
    On my machine I don't have an /etc/inittab file I have only /etc/init directory with config files and a /etc/init.d directory with programs and shell scripts.

    question 2
    Is their something besides x11 some alternative or does every desktop/windows manager and gui program for linux/unix based os's run on x11 with no-alternatives?

    question 3
    I have seen Xorg in my process what is this is their a difference between it and xinit?

  10. #9
    If you can follow shell scripts at all, you can trace the flow. There will be one script called by inittab, which then calls a series of other scripts. Look at /etc/inittab and look for a line similar to one of the following:
    The relevent fields here are the third and last fields (where it says bootwait is field 3, where it says /etc/rc is the last field). Either bootwait or sysinit will cause the process to be run during boot, with slightly different meanings. The last field gives the path to the program to be run. These are just examples. Real cases will be different for almost every distro.

    Regarding alternatives to x11 there aren't any really functional ones - yet. Microwindows/NonoX is under development for embedded use but doesn't do much yet. Wayland is a project under development and sponsored by Canonical that may one day be a viable replacement. There are two common X11 implementations, Xorg and Xfree86, but Xorg is almost universal now since Xfree86 development is fairly stalled and licensing issues caused a mass-migration.

    The difference between Xorg and xinit is relatively simple. Xorg is the actual X server, while xinit is a script that you call in order to start Xorg with some useful parameters.

    Init shouldn't really call xinit at all, either. If a login manager is called by init, most likely the login manager has it's own recipe for starting X rather than using the xinit script.

  11. #10
    Thank you , you answered alot of my questions.

    Question 2
    Curious, is Xorg the older of the 2 X11 implementations or is Xfree86 older. Does Xfree86 run on non-x86 machines like arm , x64 , mips ,...etc or just x86? I am assume xorg can run on just about anything since I have linux running on my x64 machine just fine.
    I know I asked the question about alternatives to x11 but would their be any reason or benefit in needing any alternatives to it. (i.e is their some flaw in how x11 should have been designed?)

    Question 1)
    Well , I don't have an etc/inittab or etc/rc but I have directories etc/init/ , /etc/init.d , etc/rcX (X=0,1,2,3,...)
    Correct me if I am wrong but init is the the main first process created pid 1 . which then executes every process/ startup script in the /etc/init.d/ or /etc/init directories. But does it execute anything else not in /etc/init.d or /etc/init/ directories?
    I think it is only the /etc/init.d directory by looking at the man page for init . Since the --confdir option allows you to change the default directory that init uses which is /etc/init.d on my machine.

    Not fully sure though.

    Question 3
    I would think lxdm calls the xinit or X11 stuff and that init calls the lxdm going by this
    ls /etc/init.d
    alsa-restore            irqbalance                  sendsigs
    alsa-store              killprocs                   setvtrgb
    apparmor                lxdm                        single
    apport                  module-init-tools           skeleton
    atd                     mysql                       smbd
    avahi-daemon            networking                  statd
    binfmt-support          network-interface           statd-mounting
    bootlogd                network-interface-security  stop-bootlogd
    casper                  nfs-kernel-server           stop-bootlogd-single
    console-setup           nmbd                        sudo
    cron                    ondemand                    tomcat6
    cryptdisks              plymouth                    ubiquity
    cryptdisks-early        plymouth-log                udev
    cryptdisks-enable       plymouth-splash             udev-fallback-graphics
    cryptdisks-udev         plymouth-stop               udev-finish
    cups                    plymouth-upstart-bridge     udevmonitor
    dbus                    portmap                     udevtrigger
    dmesg                   portmap-boot                ufw
    dns-clean               portmap-wait                umountfs
    ecryptfs-utils-restore  pppd-dns          
    ecryptfs-utils-save     procps                      umountroot
    failsafe-x              rc                          unattended-upgrades
    grub-common             rc.local                    urandom
    gssd                    rcS                         vboxballoonctrl-service
    halt                    README                      vboxdrv
    hostname                reboot                      vboxweb-service
    hwclock                 rpc_pipefs                  wicd
    hwclock-save            rsync                       x11-common
    idmapd                  rsyslog
    ircd-irc2               screen-cleanup

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts