Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
So I'm trying to run a GLUT program on Ubuntu 12.04 and forward it in its entirety to a VNC client. I'd like the GLUT window to be the only ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie Syndacate's Avatar
    Join Date
    May 2012
    Location
    Hell..no literally, this state is hell..
    Posts
    192

    Trouble Running VNC Server


    So I'm trying to run a GLUT program on Ubuntu 12.04 and forward it in its entirety to a VNC client. I'd like the GLUT window to be the only thing the VNC client sees, but whatever.

    Right, so my xstartup file looks like this:
    Code:
    #!/bin/sh
    
    # Uncomment the following two lines for normal desktop:
    #unset SESSION_MANAGER
    #exec /etc/X11/xinit/xinitrc
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    #x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    #x-window-manager & startx &
    /home/<username>/Desktop/TEST/run.sh
    I've tried all different configs, I tried uncommenting the first two lines, I initially tried just starting "gnome-session &" as the thing to run, that didn't work. The terminal launches fine, though.

    If I try opening this application (which is windowed through GLUT) I get the same error with the above configuration script as if I just try to open it through the terminal, which is:
    Code:
    freeglut (/home/<username>/Desktop/TEST/a.out):  ERROR:  Internal error <FBConfig with necessary capabilities not found> in function fgOpenWindow
    X Error of failed request:  BadWindow (invalid Window parameter)
      Major opcode of failed request:  4 (X_DestroyWindow)
      Resource id in failed request:  0x0
      Serial number of failed request:  18
      Current serial number in output stream:  21
    I really don't know anything about VNC, first time I used it was today, so forgive my noobishness. I can't figure out what the heck it's complaining about, though. I mean it looks like it's having trouble forwarding the window, but I really don't know how VNC works, and I have no idea how to go about trying to fix this.

    The fact that the resource handle is null (0) is probably a problem, but again, for all I know that can simply be the first index.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Have you actually started the VNC server? That xstartup script is read by the VNC server when it starts. You can start it manually like this:
    Code:
    vncvserver: 1
    Where the :1 is the display number. Once it fires up, it will read ~/.vnc/xstartup and attempt to execute it.

    you should then be able connect from any remote machine (or the same one, too) like this:
    Code:
    vncviewer <IP_ADDRESS>:1
    if connecting remotely, be mindful of firewall rules.

    you can check the log file ~/.vnc/hostname:1.log for errors.

  3. #3
    Linux Newbie Syndacate's Avatar
    Join Date
    May 2012
    Location
    Hell..no literally, this state is hell..
    Posts
    192
    Quote Originally Posted by atreyu View Post
    Have you actually started the VNC server? That xstartup script is read by the VNC server when it starts. You can start it manually like this:
    Code:
    vncvserver: 1
    Where the :1 is the display number. Once it fires up, it will read ~/.vnc/xstartup and attempt to execute it.

    you should then be able connect from any remote machine (or the same one, too) like this:
    Code:
    vncviewer <IP_ADDRESS>:1
    if connecting remotely, be mindful of firewall rules.

    you can check the log file ~/.vnc/hostname:1.log for errors.
    Yes, I have started the VNC server and can connect to it just fine. I had (above) started it with display 1, and it launched fine.

    The default xstartup script launches a GUI terminal in Ubuntu, as you can see above (x-terminal-emulator). This works exactly as it should. Though I was wondering how to get the GLUT window which that shell script launches (just a regular C++ executable which is using GLUT/OpenGL to render an image) as the window being shown... It would be more ideal if I can somehow pipe the frame buffer data out of GLUT into the display, so I could view the image "full screen" - without the boarder being rendered and such.

    It seems that glut is missing some function, configuration, context, etc. which VNC uses to render it. I need to figure out that as well as how to dump the window manager aspects (the boarder), eventually. I guess I might have posted this in the wrong place, I need people who know VNC WELL.

    If the above doesn't make any sense, let me know which part and I can try to clarify.

    EDIT:
    I can't pull the logs now but I'm 99% sure the logs said the same thing as the error message dumped to standard out (which I posted above) with regards to running that program.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Syndacate View Post
    Yes, I have started the VNC server and can connect to it just fine.
    okay, just making sure. had to rule out the easy stuff.

    Though I was wondering how to get the GLUT window which that shell script launches (just a regular C++ executable which is using GLUT/OpenGL to render an image) as the window being shown... It would be more ideal if I can somehow pipe the frame buffer data out of GLUT into the display, so I could view the image "full screen" - without the boarder being rendered and such.
    i assume the DISPLAY variable is getting set properly?

  5. #5
    Linux Newbie Syndacate's Avatar
    Join Date
    May 2012
    Location
    Hell..no literally, this state is hell..
    Posts
    192
    Quote Originally Posted by atreyu View Post
    okay, just making sure. had to rule out the easy stuff.


    i assume the DISPLAY variable is getting set properly?
    NP.

    I'm not sure about the DISPLAY var, I'll have to check tonight. Though I'm assuming if it wasn't working correctly, I wouldn't be able to get a GUI terminal as I can with the default xstartup script? That part works exactly as it should.

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Syndacate View Post
    I'm not sure about the DISPLAY var, I'll have to check tonight. Though I'm assuming if it wasn't working correctly, I wouldn't be able to get a GUI terminal as I can with the default xstartup script? That part works exactly as it should.
    yes, you're probably right. but figured i'd ask. i know some GTK apps accept the --display parameter so thought it would be worth a try. i assume the prog works when executed in a local X session?

  7. #7
    Linux Newbie Syndacate's Avatar
    Join Date
    May 2012
    Location
    Hell..no literally, this state is hell..
    Posts
    192
    Quote Originally Posted by atreyu View Post
    yes, you're probably right. but figured i'd ask. i know some GTK apps accept the --display parameter so thought it would be worth a try. i assume the prog works when executed in a local X session?
    If by X session you mean like, original X, I haven't tried. It runs fine with X/GTK (Gnome3) though.

  8. #8
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by Syndacate View Post
    If by X session you mean like, original X, I haven't tried. It runs fine with X/GTK (Gnome3) though.
    yeah, i meant Xorg, so if it runs in a GNOME3 session, then that's what I was talking about. Have you tried an alternative to VNC, as a work-around? I know there is NX NoMachine. And there is also x0rfb, which allows remote control of the :0 display (kind of like how VNC for Windows works). These days, I think it is built into some display managers, so there may be DM-specific packages.

  9. #9
    Linux Newbie Syndacate's Avatar
    Join Date
    May 2012
    Location
    Hell..no literally, this state is hell..
    Posts
    192
    Quote Originally Posted by atreyu View Post
    yeah, i meant Xorg, so if it runs in a GNOME3 session, then that's what I was talking about. Have you tried an alternative to VNC, as a work-around? I know there is NX NoMachine. And there is also x0rfb, which allows remote control of the :0 display (kind of like how VNC for Windows works). These days, I think it is built into some display managers, so there may be DM-specific packages.
    I haven't really tried alternatives to VNC, though I read up a tad on xrdp as a possible alternative.

    Currently I'm using x11vnc as a server which allows the connection to display :0. Then the app ran through the virtual GL translator seems to work (most of the time, anyway).

    Though now I'm facing the problem where I have the whole desktop on the VNC viewer, and this isn't ideal. Ideal is having just the window visible to the viewer (preferably without the boarder, but that's another story I guess). So I think I have to start it on a different display...but I can't. This same setup, if I try to launch x11vnc on display :1, then connect to it, the error logs show the same error message I've been dealing with (that it's missing some capabilities to display it, much like the error message in the link in the OP).

    Damn this thing.

    I don't need VNC per-se, that simply makes my life a lot easier. I realistically need to get a bunch of 'pixel data' (not quite pixel data, but close enough) and display it on a remote device, while the remote device can pass certain keys to the server. I just picked VNC as it should have been able to mate with the window well and forward the image over while handling input to the host. The downside to possible RDP protocols is that sometimes you lose quality, and I cannot have that.

    My purpose is to avoid writing the server myself...but this is looking less and less feasible every day...not to mention then I have to deal with data compression and I would just rather not....especially on my truncated time frame.

  10. #10
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Have you looked at SharedAppVNC? It might have the same limitations as straight VNC, but maybe it would allow you to focus on a single app and not a whole desktop.

Page 1 of 2 1 2 LastLast

Posting Permissions

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