Computer Science Canada

Chaging location of X server

Author:  DtY [ Fri Sep 11, 2009 8:05 pm ]
Post subject:  Chaging location of X server

I got a macbook today (Very HappyVery HappyVery HappyVery HappyVery Happy), and want to run Fedora in a VM. I have VMWare and Fedora up and working, but I don't want to fork over the resources to run an X-Server (especially memory) when OSX already has an X Server running (I did not know it did, but that saves a lot of trouble)
So, what I want to do, is make Fedora boot without X (I know how to do this) and then make any X programs I start use the Mac's X server.
From what I know already, this would involve two steps: Allowing the Mac's X server to accept external connections (since the VM is technically an external computer), and then telling Fedora that that's where the X server is.

Thanks

btw, I don't want a desktop environment, just to be able to run X programs

[edit] Oh, and question, does anyone know, or know a website that explains how to do those two steps?

Author:  rdrake [ Fri Sep 11, 2009 8:24 pm ]
Post subject:  RE:Chaging location of X server

No, but I find it amusing that you used the maximum amount of smilies possible in a post.

Author:  DtY [ Fri Sep 11, 2009 8:37 pm ]
Post subject:  Re: RE:Chaging location of X server

rdrake @ Fri Sep 11, 2009 8:24 pm wrote:
No, but I find it amusing that you used the maximum amount of smilies possible in a post.

I had a few more, but it wouldn't let me post Sad

Author:  andrew. [ Fri Sep 11, 2009 9:01 pm ]
Post subject:  RE:Chaging location of X server

There must be a way because I think that you can do something like this with a jailbroken iPhone/iPod touch. I see in the preferences of X11 there is something about connections in the security tab. I don't know if it helps though.

Author:  [Gandalf] [ Fri Sep 11, 2009 9:12 pm ]
Post subject:  Re: Chaging location of X server

No idea, however:
Posted Image, might have been reduced in size. Click Image to view fullscreen.
...and then the forums exploded. Good times. Razz Mad

Author:  DtY [ Fri Sep 11, 2009 9:17 pm ]
Post subject:  Re: RE:Chaging location of X server

andrew. @ Fri Sep 11, 2009 9:01 pm wrote:
There must be a way because I think that you can do something like this with a jailbroken iPhone/iPod touch. I see in the preferences of X11 there is something about connections in the security tab. I don't know if it helps though.

Okay, I enabled allow network connections. Now does anyone know how to make my Linux "computer" send X somewhere else?
I heard somewhere that it's an environment variable, but I checked env and found nothing useful (ie. nothing set to localhost or 127.0.0.1), so if it is, it's not set right now.

Author:  andrew. [ Fri Sep 11, 2009 9:35 pm ]
Post subject:  RE:Chaging location of X server

Maybe this or this. Don't know if that's what you're looking for.

Author:  DtY [ Fri Sep 11, 2009 9:38 pm ]
Post subject:  Re: RE:Chaging location of X server

andrew. @ Fri Sep 11, 2009 9:35 pm wrote:
Maybe this or this. Don't know if that's what you're looking for.

Nope Sad I can run gui applications the way I want if I SSH into the VM, but I want to start them from within the VM.

[edit] That second one looks relevant actually, I should read past the title Smile
I'll let you know if it works

Author:  DtY [ Fri Sep 11, 2009 10:30 pm ]
Post subject:  RE:Chaging location of X server

Okay, still not working, I get the error that it cannot open the display.
I'm not sure what's wrong, I added my VM's IP address to xhost, and then even tried with my name.
Also, there are two networks in mac os: vmnet8 and vmnet1, what's the different between these two? I can ping both, but cannot cannot to X on either

[edit] I can connect to both on port 6000 (X port) with telnet
[edit 2] Just got it working, you have to put the display number at the end of the DISPLAY variable, so it would be
export DISPLAY=xx.xx.xx.xx:0.0

If I want this in my environment at every boot, what file do I need to put that in? .bashrc?

Author:  rdrake [ Fri Sep 11, 2009 11:05 pm ]
Post subject:  Re: RE:Chaging location of X server

DtY @ Fri Sep 11, 2009 10:30 pm wrote:
If I want this in my environment at every boot, what file do I need to put that in? .bashrc?
code:
~/.bash_profile

Author:  DtY [ Sat Sep 12, 2009 7:04 am ]
Post subject:  RE:Chaging location of X server

Thanks

Author:  andrew. [ Sat Sep 12, 2009 9:36 am ]
Post subject:  RE:Chaging location of X server

So did you get it working? If so, can I see a screenshot? It sounds cool.

Author:  DtY [ Sat Sep 12, 2009 9:50 am ]
Post subject:  Re: RE:Chaging location of X server

andrew. @ Sat Sep 12, 2009 9:36 am wrote:
So did you get it working? If so, can I see a screenshot? It sounds cool.

Yup, it's working exactly how I want Smile
Except one of my C programs is seg faulting when I run it, even if I ssh into my desktop and run it off there (displaying locally), but that's probably my fault. (It runs fine if I run it on my desktop)

Posted Image, might have been reduced in size. Click Image to view fullscreen.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
(For anyone who doesn't get what's going on, gedit is running in the virtual machine running Linux, but displaying on the Mac)

[edit] Oops, I left the arch folder on the desktop. Inevitably, someone's going to ask why I didn't use that.
In short, I gave up. I installed it, then "took the CD out and rebooted", and got an error saying that the "drive" wasn't bootable (VMWare error, not an arch error). The same thing happened when I tried installing Fedora, so I gave up and used a pre made VM.
I'll try it again later.

Author:  andrew. [ Sat Sep 12, 2009 4:02 pm ]
Post subject:  RE:Chaging location of X server

Very nice. But may I ask why you didn't just install GNOME or KDE on your Mac? You can have them running with the Mac desktop environment. This guy posted a screenshot on his site.
Posted Image, might have been reduced in size. Click Image to view fullscreen.

Author:  DtY [ Sat Sep 12, 2009 7:58 pm ]
Post subject:  RE:Chaging location of X server

I wanted to have Linux, probably all the programs I use have been ported to OS X, so I guess mostly because I can.

Author:  andrew. [ Sun Sep 13, 2009 8:48 am ]
Post subject:  RE:Chaging location of X server

Oh, I guess that works. Just be careful with the heat of your laptop, it will probably get very hot after a while of having the VM open.


: