9

Is there are a way to connect to dom0 using VNC without running X? I don't want an X server, I just want to see what is on the console.

EDIT: Adding some background, since people seem to be really annoyed that I would ask such a question and that ssh isn't an acceptable solution in this case for getting to dom0:

The reason I want to VNC to the console is NOT for the purpose of managing this system (actually 600 laptops running Debian Squeeze with Xen and multiple VMs for 4 days at a conference in August). SSH works great for that, and I wouldn't dream of using anything else for management. But, there are two major things that I want to be able to do:

1) See EXACTLY what is on the actual /dev/console while talking to someone who is sitting in front of the machine. A small team of people are responsible for preparing these systems for the conference, and we aren't all geographically located in the same place. In this case, these systems are 3000 miles from me, 5000 miles from another member of the team, and ~100 miles from a third. Being able to see what is on the screen is of tremendous importance when working with "remote hands" who are sitting in front of a system trying to figure out why some particular task isn't working properly.

2) See any error messages that were sent to /dev/console and no-where else (which happens WAY more often than I would have guessed prior to starting this project). I've determined there are two primary reasons that this occurs: 1) sometimes lazy developers log errors or debug output to /dev/console by way of a redirect, without bothering to use the system's logger or other functionality that causes the error to get recorded in a file; and 2) when your IO subsystem has collapsed because of something bad happening, but network and cpu are still fine, error messages won't get recorded in a log file immediately prior to the system crashing and burning. At least if I had been working in /dev/console, I'd be able to see the error message instead of having to call someone and ask them to take a picture of the screen for the 20 or 30 seconds that it is on the console before the system reboots.

It would also be pretty freaking cool to bring up little tiny windows on all 600 machines on a giant display (well, lots of displays), during the conference, and see what is happening on each one.

7
  • Wow, two down votes, and neither person who bothers to mention WHY they down voted so that I can learn and fix it. Server Fault community, I am disappointed in you. Jul 24, 2011 at 4:40
  • I will try to improve the question anyway, since clearly SOMETHING is wrong, but I can only guess as to what. Jul 24, 2011 at 4:54
  • +1 for the details. I just couldn't figure out what you were trying to do or why you were trying to do it. This is cool.
    – user62491
    Jul 24, 2011 at 19:38
  • @kce Thanks, I appreciate the comment. I suppose I should have explained my reasons initially, but I didn't really expect so much resistance to the initial question. Jul 24, 2011 at 21:38
  • It's actually a really great question (particularly now that I understand what you're trying to accomplish), but without the details it just sounded like a complicated way to re-invent the wheel... then again I've never been in the position of handing over management of a Dom0 to anyone other than me or anyone else who is in-house.
    – user62491
    Jul 25, 2011 at 2:13

3 Answers 3

4

So, I've found the answer, as a result of another answer that was totally condescending and really upset me (and was deleted), but forced me to dig and dig to figure out how to do this. The answer lies within x11vnc, which was apparently created partly for this purpose. Luckily, Xen actually installs x11vnc for me, so I don't even have to install it. Just run:

sudo x11vnc -rawfb console

and blammo, vnc to the console. Like a KVM, but requires network. There are a million options for x11vnc, and I haven't explored them all yet, but this is perfect and exactly what I need. To run it in the background, add a bg flag:

sudo x11vnc -bg -rawfb console
3
  • Out of curiosity, how is this different than accessing the Dom0 via SSH?
    – user62491
    Jul 23, 2011 at 20:45
  • Because I can view what is happening on the console when a real user is sitting in front of the system, see error messages that were sent to /dev/console and no where else, and most importantly, do those two things at any moment of the day for the 600 systems I'll be monitoring for 4 days in august (simultaneously, if I so choose). Jul 24, 2011 at 4:38
  • I don't like answering my own question, and had not intended to do so in this case. I will refrain from accepting this answer until the system starts harassing me to accept it, in case anyone has a better or more thorough solution. Jul 24, 2011 at 4:53
2

What about the 'screen' command's -rx option - which allows you to connect to an already active screen session of a user on the local machine, and see and interact with everything they see.

It could get a bit hairy trying to keep your wits with several hundred screen sessions - but it hardly seems worse than several hundred VNC session...

4
  • In case what i'm proposing isn't totally clear: user on local machine opens console. user on local machine runs screen. you ssh to that machine. you then invoke screen -rx. You then see that user's screen session, and anything/everything that is sent to that session by the system. You can also issue commands and the local user will see exactly what you type (which can provide an impromptu 'chat' ability)...
    – anastrophe
    Jul 24, 2011 at 6:00
  • An interesting solution, thanks for thinking out of the box here. This could handle the shared session goal, but would errors sent to /dev/console show up on the remote screen session? Jul 24, 2011 at 6:19
  • I was about to say 'doesn't look like it', but I found that it may be possible. I justed tested it against one of my servers (centos 5.5). There's a facility in screen to grab console output - 'ctrl-a :console on'. From the manpage: "Grabs or un-grabs the machines console output to a window. Note: Only the owner of /dev/console can grab the console output. This command is only available if the machine supports the ioctl TIOCCONS." I redirected a server's maillogs to /dev/console in syslog.conf, and ran the above - and it worked. You'll have to test if this works in Debian, of course.
    – anastrophe
    Jul 24, 2011 at 7:04
  • Cool. Good to know, and have recorded here in Server Fault. I think I'll implement the vnc solution in this particular case (these systems don't have screen installed, but x11vnc comes as part of xen), but you definitely get a +1. Jul 24, 2011 at 21:37
0

I'm not sure what you mean by console. If you need command-line access to the Dom0's operating system SSH should be sufficient for both Citrix's XenServer or any DIY Linux/NetBSD implementation. If you need to see the Dom0's hardware's "console", you need something like iLO or another Out-Of-Band management facility (which VNC by definition cannot provide).

1
  • console: /dev/console Jul 23, 2011 at 20:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .