LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2009, 03:27 PM   #1
fish_hawk
LQ Newbie
 
Registered: Jul 2009
Distribution: Karmic 9.10
Posts: 9

Rep: Reputation: 0
Start up Gnome Desktop from Remote Terminal?


I looked around for threads addressing this issue and some have come close to answering it, but I have yet to see a definitive yes or no. Anyway - Here's my issue:

Background:
I can SSH into my home computer (Ubuntu 9.04 running Gnome) from work (Win XP Pro) using RealVNC via Putty tunnels. This has been working flawlessly for me for awhile now. I was messing around in the terminal window and accidentally rebooted the linux box (home computer) while I was at work. No big deal I thought. So I re-start the Putty connection, and it is back up in no time. Then I try to start the VNC connection, and no go, connection refused. I remember seeing that in order for the VNC connection to work, I had to be logged into the Gnome desktop already on the Ubuntu box.

Question:
Is it possible to log in and start up a Gnome desktop session from the terminal command line in Putty so I can get the VNC connection back?

Your help is much appreciated!
Thanks,
 
Old 07-27-2009, 09:09 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,388
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
This can be done. I don't have an Ubuntu system here to fully test these, but here are some ideas (and there will be other ways to skin the cat too).

(1)

You can set up gdm to autologin a particular user; this goes in /etc/X11/custom.conf:
[daemon]
TimedLoginEnable=true
TimedLogin=your_username
TimedLoginDelay=0

And then you can restart gdm:
sudo /etc/init.d/gdm restart

You might want to remove the autologin when you have finished so it doesn't happen every time you boot the machine.

(2)

You can bypass the display manager altogether, and just run 'startx' or 'xinit' directly.

To do this, you will have to allow non-console (ie remote) users to start X, in /etc/X11/Xwrapper.config:
allowed_users = anybody

Kill the display manager:
sudo killall gdm

And restart X (do not sudo):
startx

There are security implications with allowing remote terminals to start X, so again, you can revert the Xwrapper.config when you have finished.
 
Old 07-28-2009, 09:28 AM   #3
fish_hawk
LQ Newbie
 
Registered: Jul 2009
Distribution: Karmic 9.10
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you!!

Thank you so much for the response neonsignal! I'm going to give this a try today to see if it works.

I forgot to mention that I'm out of town for a week, so this will be a lifesaver if I can get it to work.

Thanks again for the help!!
 
Old 07-28-2009, 03:00 PM   #4
fish_hawk
LQ Newbie
 
Registered: Jul 2009
Distribution: Karmic 9.10
Posts: 9

Original Poster
Rep: Reputation: 0
Results

Here's the results I got from Option #1:
X: warning; process set to priority -1 instead of requested priority 0

Fatal server error:
Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.


Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.

ddxSigGiveUp: Closing log
Invalid MIT-MAGIC-COOKIE-1 keygiving up.
xinit: Resource temporarily unavailable (errno 11): unable to connect to X ser ver
xinit: No such process (errno 3): Server error.


And results for Option #2:
xauth: /home/matt/.Xauthority not writable, changes will be ignored
xauth: error in locking authority file /home/matt/.Xauthority
xauth: error in locking authority file /home/matt/.Xauthority
xauth: error in locking authority file /home/matt/.Xauthority

X.Org X Server 1.6.0
Release Date: 2009-2-25
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.24-23-server i686 Ubuntu
Current Operating System: Linux HH1 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2 009 i686
Build Date: 09 April 2009 02:10:02AM
xorg-server 2:1.6.0-0ubuntu14 (buildd@rothera.buildd)
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Jul 28 14:54:00 2009
(==) Using config file: "/etc/X11/xorg.conf"

(WW) SIS: No matching Device section for instance (BusID PCI:0@0:0:0) found

Do you know what I'm doing wrong here? I tried to VNC into the machine after each of these options, and both resulted in "Connection Refused" errors in the VNC viewer.

Thanks!
 
Old 07-28-2009, 06:14 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,691

Rep: Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264
I have a dumb question, would telinit command work?
 
Old 07-28-2009, 07:35 PM   #6
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,388
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Sorry, it is hard for me to test specifically for Ubuntu. I'm trying it out on a Debian system running Gnome, which is a slightly different setup.

The first warning indicates some issue with being restarted from the wrong user:
Code:
X: warning; process set to priority -1 instead of requested priority 0
You could try splitting up the process to try to figure out where this is failing:
Code:
sudo /etc/init.d/gdm stop
sudo /etc/init.d/gdm start
The message that followed is simply telling you that you were starting gdm/X a second time (because of the restart failure), so the second X could not grab the display:
Code:
Server is already active for display 0
---

As to the second option, the fact that .Xauthority is not writable again says that ownership of the X does not work on Ubuntu quite as I expected. You can do 'ls -l .Xauthority' to see whether you own it.

However, it looks like X actually did start. I am not sure why the SIS driver gave the error "No matching Device section", which seems to indicate that again, the driver couldn't grab the display (perhaps because X was already running, and it didn't get killed earlier). But perhaps this relates to the authority file issue.

Incidentally, do you have the vncserver setup to run automatically on your home machine? If not, you will also need to start it after X is going, I believe something like 'vncserver :1'?

I also should have said to use an '&' on startx, so that you could keep using the terminal while X was running ('startx &'), but that is no big deal.

---

I'm not sure how much this is helping you. If you get stuck, you can forcefully kill all the X related processes:
Code:
sudo killall gdm startx xinit
sudo rm /tmp/.X0-lock
just to make sure everything is back to where you started, and then attempt to start again (using gdm or startx).

Last edited by neonsignal; 07-28-2009 at 07:58 PM.
 
Old 07-28-2009, 07:40 PM   #7
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,388
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Oh, and regarding the 'telinit' comment from jefro - I would steer clear of this, because at best you will reset the machine, and at worst you will end up without sshd running or accessible and will not be able to remotely access the machine at all.
 
Old 09-16-2009, 08:47 AM   #8
fish_hawk
LQ Newbie
 
Registered: Jul 2009
Distribution: Karmic 9.10
Posts: 9

Original Poster
Rep: Reputation: 0
Just an update on this - I never did get the desktop to start up remotely. I always need to make sure I log in to the machine before leaving for work to make sure I can get the desktop to come up remotely. Luckily I can always get to the terminal via putty. Good thing I don't have to restart this thing ALL the time like a windows box!!

Thanks again for the help neosignal - much appreciated!
 
Old 09-16-2009, 09:48 AM   #9
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
@ fish_hawk

I have used VNC all the time for this, as you have done. The problem looks interesting and I did a bit of Google search and got this link,

http://www.linux-tip.net/cms/content/view/302/26/

Have not tested it out myself.

Regards,

--
Prasanta
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting Remote Logon - Starting Remote Gnome Desktop klmukp Linux - Newbie 1 09-21-2008 01:13 AM
How can I start VirtualBox on a remote machine and log out from the terminal? crisostomo_enrico Solaris / OpenSolaris 2 08-09-2008 04:02 AM
Remote Desktop and Remote Terminal cad Linux - Software 2 08-15-2007 03:20 AM
Problems accesing Gnome via remote terminal guarriman Linux - General 3 02-22-2005 10:21 AM
Gnome terminal does not start...? perry Linux - Newbie 0 11-21-2003 06:41 PM


All times are GMT -5. The time now is 01:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration