LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Logging in to the GUI from the shell (https://www.linuxquestions.org/questions/linux-server-73/logging-in-to-the-gui-from-the-shell-4175430680/)

metallica1973 10-05-2012 09:15 AM

Logging in to the GUI from the shell
 
I have an Ubuntu 12.04 LTS server running GNOME shell,that I occassionly have to remotely access to perform some maintenance. I usually vpnc into the network and then simply use vncviewer to access the Gnome GUI desktop for testing,given that the account is logged in. The other day I had to reboot the server remotely and had forgotten that the system was not set to automatically login. Having issues trying to get the automatic login to work correctly, I had to call someone at the site to log me into the desktop. Is there a way that I can login in the GUI account from the cli remotely so I can continue with my testing using the gui for that account? My display Manager is GDM not LightDM.

jettwa2001 10-06-2012 01:25 PM

Hi there,
You can try the command startx or init 5
also look in /etc/grub.conf

This is mine notice that I have the number 3 in the end boot option, in your case change it to 5

[root@home ~]# cat /etc/inittab
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /etc/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To set a default target, run:
#
# ln -s /lib/systemd/system/<target name>.target /etc/systemd/system/default.target
#
[root@home ~]# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_home-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.43.8-1.fc15.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.43.8-1.fc15.x86_64 ro root=/dev/mapper/vg_home-lv_root rd_LVM_LV=vg_home/lv_root rd_LVM_LV=vg_home/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us selinux=0 rhgb quiet 3
initrd /initramfs-2.6.43.8-1.fc15.x86_64.img

pingu 10-06-2012 02:37 PM

That won't log him in I'm afraid, it's good advice how to make X load at bootup but as I read the question X is started but OP needs to be logged in to the GUI on server.

metallica1973 why do you need to be logged in?
Do you know that you can run GUI-apps from server on your PC using ssh with X-forwarding?
In case you don't know, here's how:
In servers /etc/ssh/sshd_config, set
"X11Forwarding yes"
Then on client, log in with ssh:
"ssh -Y <me>@<server>"
you'll get a standard terminal, start your apps with for instance "kate &", the app will run on server but is displayed on your desktop.

If that is not enough & you want to log in to your desktop on server remotely, there are several "RemoteDesktop"-applications around. Haven't used any in Linux myself, but checkout this page: http://www.mynitor.com/2010/02/07/15...ons-for-linux/

If this is no help to you, please return with info about why you have to be logged in on server.

Wim Sturkenboom 10-07-2012 02:28 AM

Quote:

Originally Posted by jettwa2001 (Post 4798921)
Hi there,
You can try the command startx or init 5

'init 5' does not work in Ubuntu as runlevels are (partially?) obsolete :(

metallica1973 10-08-2012 12:06 PM

Quote:

metallica1973 why do you need to be logged in?
Do you know that you can run GUI-apps from server on your PC using ssh with X-forwarding?
In case you don't know, here's how:
In servers /etc/ssh/sshd_config, set
"X11Forwarding yes"
Then on client, log in with ssh:
"ssh -Y <me>@<server>"
you'll get a standard terminal, start your apps with for instance "kate &", the app will run on server but is displayed on your desktop.
Thanks for all the replies. The reason that I need to remotely login and do my work from the customer point of view is because this system is a security system running "Zoneminder". The system is configured to display all the cameras comsuming the whole screen. Over the weekend I remembered in the past using x2vnc which allowed me to remotely view the GDM display manager and login to any account. This system is using "Vino-Server" and I havnt figured out how to change the configuration to allow me to do that yet.

PHP Code:

ps -ef|grep -i vino 
testuser   2357  2227  0 Oct04 
?        00:00:01 /usr/lib/vino/vino-server --sm-disable 



All times are GMT -5. The time now is 04:08 PM.