Search This Blog

Sunday, April 23, 2017

Centos 7 Booting automatically into Graphical mode

Centos 7  installation end up into terminal mode start up ,if no INTERNET connectivity within VM instance.

running "dhclient" command resolved this problem for session.For permanent solution we need to check our Instance settings in Virtual Box.

In settings --> Network modify as follows

1)  Enable Network Adapter
2)  Select "Bridged Adapter" from "Attached to" dropdown
3)  select interface (eth0) from "Name" dropdown
4) Check "Cable Connected"  checkbox from Advanced Section
5) Promiscuous Mode to Deny (Default)

On host Linux machine run ifconfig and check active interface usually its "eth0".Save Changes & and restrat VM instance.
   Now from Command Prompt in Guest OS run

   ping google.co.in

to check if internet is accessible or not.

Now we have to install Gnome as follows

        yum groups install "GNOME Desktop"

we will check current target

    systemctl get-default

Output expected is "graphical.target", if not then it will first boot into terminal then we have to run manually "startx" command for graphical mode.

Lets set system to automatically boot into graphical mode so we have to set default display manager with gnome installed we are going for "gdm" (other choices are kdn,xdm).

    sudo systemctl enable gdm.service
    sudo systemctl set-default graphical.target

We can revert back to terminal mode using following

    sudo systemctl disable gdm.service
    sudo systemctl set-default multi-user.target


In older system usually there was setting of runlevel called "initd" ,which is currently replaced by "systemd".

Both this system used for initialization of system during boot process . also used for starting & stopping services usually refered as daemon.

The key file in this regard was  "/etc/inittab" ,which need to be edited suitablly.

    For logging into terminal initdefault need to set as 3    

        id:3:initdefault:

    For logging into graphical mode initdefault need to set as 5

        id:5:initdefault:

    Initd Equivalent for "systemctl get-default" command is
   
        cat /etc/inittab | grep initdefault

    Relating Systemd & Initd

           Init RunLevel    Systemd Target         Run Level Description

        0     poweroff.target            The halt runlevel - this is the runlevel at which the system shuts down. For obvious reasons it is
                           unlikely you would want this as your default runlevel.

        1     rescue.target           Single runlevel. This causes the system to start up in a single user mode under which only the root user can log in. In this
                                                   mode the system does not start any networking or X windowing, X or multi-user services. This run level is ideal for system
                                                   administrators to perform system maintenance or repair activities.

        2     multi-user.target       Boots the system into a multi-user mode with text based console login capability. This runlevel does not, however, start the
                                                   network.

        3     multi-user.target       Similar to runlevel 2 except that networking services are started. This is the most common runlevel for server based systems
                                                   that do not require any kind of graphical desktop environment.

        4     multi-user.target       Undefined runlevel. This runlevel can be configured to provide a custom boot state.

        5     graphical.target       Boots the system into a networked, multi-user state with X Window System capability. By default the graphical desktop
                                                   environment will start at the end of the boot process. This is the most common run level for desktop or workstation use.

        6     reboot.target               Reboots the system. Another runlevel that you are unlikely to want as your default.

        Please refer http://www.linuxtopia.org/HowToGuides/runlevel.html for more information on initd



    References :
          http://landoflinux.com/linux_runlevels_systemd.html
          http://www.linuxtopia.org/HowToGuides/runlevel.html
          http://www.linfo.org/runlevel_def.html
          https://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/
       

No comments:

Post a Comment