X Session from Mac

3

2

How can I log into an X server from Mac OS X? I know that ssh -X username@host will log me in and I will have the capability to run X applications.

On Cygwin/X you can log in and have a whole X session from your computer... and it will look something like this:

enter image description here

How can I replicate this?

Using this batch script:

@echo off
SET DISPLAY=127.0.0.1:0.0

SET REMOTE_HOST=%1

IF "%REMOTE_HOST%" == "" SET REMOTE_HOST=10.0.0.1

SET CYGWIN_ROOT=\cygwin
SET RUN=%CYGWIN_ROOT%\bin\run -p /usr/bin

SET PATH=.;%CYGWIN_ROOT%\bin;%PATH%

SET XAPPLRESDIR=
SET XCMSDB=
SET XKEYSYMDB=
SET XNLSPATH=

if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH
attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0
del %CYGWIN_ROOT%\tmp\.X11-unix\X0

:CLEANUP-FINISH
if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix


if "%OS%" == "Windows_NT" goto OS_NT

echo startxdmcp.bat - Starting on Windows 95/98/Me

goto STARTUP

:OS_NT

REM Windows NT/2000/XP
echo startxdmcp.bat - Starting on Windows NT/2000/XP

:STARTUP

%RUN% XWin -query tekknolagi.dyndns.org -clipboard -lesspointer -scrollbars -screen 0 1050x1655@2 -screen 1 1680x985@1

tekknolagi

Posted 2011-09-16T00:14:15.267

Reputation: 1 130

Maybe you can give some more details on how you do it in cygwin/X? – tidbeck – 2011-11-18T12:48:13.820

@tidbeck ok! updating the q – tekknolagi – 2011-11-19T08:16:44.473

Answers

4

install an xserver on macos: http://xquartz.macosforge.org/trac/wiki

launch it in fullscreen.

akira

Posted 2011-09-16T00:14:15.267

Reputation: 52 754

installed; how do i launch fullscreen? and can I have the same effect? – tekknolagi – 2011-09-16T00:47:50.310

okay i figured out fullscreen - how do i achieve this same effect? – tekknolagi – 2011-09-16T00:57:40.940

which "effect"? – akira – 2011-09-16T05:52:19.947

of the image i posted; a full x session – tekknolagi – 2011-09-16T06:46:28.313

launch the apps you see in your screenshot on the mac. if you want to automate that: write a script (a so called 'session script'). – akira – 2011-09-16T07:49:10.477

that doesn't create the background and a whole separate window and everything – tekknolagi – 2011-09-16T14:31:47.320

"the apps you see" also includes the tool which sets the background (xsetroot). with "the windowing" i assume you mean "the window management" .. and for that (which is also included in "the apps you see") launch twm. – akira – 2011-09-16T14:41:39.567

ooh thanks! can I use Xnest? – tekknolagi – 2011-09-17T05:03:36.467

why do you want to run a pseudo-xserver inside xquartz? and yes, if xnest is available in whatever form on macosx (think 'brew', think 'macports').. then you can start it. – akira – 2011-09-17T08:48:41.763

2

If you have privileges to install stuff on the linux (and OS X) machine you can install NX Server/Player from NoMachine. It will forward X sessions and only uses ssh for communication.

tidbeck

Posted 2011-09-16T00:14:15.267

Reputation: 1 365

i have privileges, but is there another utility that does not require them? – tekknolagi – 2011-11-18T08:46:41.217

0

Recentish OS X systems come with an X server, but it's not installed by default. Install that, and it'll create X11.app. When you run that, you get a very different-looking terminal window. In there, do your ssh -X and you'll have a local X server that will run applications from the server. Launch (for example) xEyes, and you'll see the app pop up on your Mac.

Regarding your batch script, that's a Windows script, and won't work on a Mac.

mauvedeity

Posted 2011-09-16T00:14:15.267

Reputation: 745

I realize it's a batch script, but that's how I recreate the image at the top. Is there a similar feature for Mac? – tekknolagi – 2011-11-19T21:21:34.150

You can use shell scripts on a Mac instead. In fact, being as Mac OS X is UNIX, you'll probably be able to use scripts from the UNIX computer you're logging in to on the Mac. – mauvedeity – 2011-11-21T05:59:33.330