How to start remote xterm in a Linux VMware image when being offline?

0

I have the following context:

  • Work under Windows 7
  • Want to develop Ruby on Rails under Linux
  • Want to use X-Windows (e.g. Sublime Text or other tools)
  • Have installed Cygwin and X-Windows

I have now the following problem: When I am offline, my host machine (Windows 7) has no IP address. When I then try to start X-Windows (locally), this works well, but I have no IP address to define the display variable for starting e.g. an xterm under Linux in the VMware image. The VMware image (Ubuntu Linux) has a stable IP address, being online or offline, but my host machine (Windows 7) has not.

Is there something I can do to work offline with X-Windows in the VMware image? I can of course use ssh, tmux and the like, but I would like to know if there is a solution to that problem.

mliebelt

Posted 2012-03-14T07:10:06.630

Reputation: 137

Answers

1

The obvious solution is to set up a host-only network in Vmware, on which Windows will have a static address. This can be done by adding another network adapter to the VM. You might have to set a static address for the interface in Windows, but this should not interfere with anything else.

Similarly, a NAT setup for the VM includes a static address for the host. If you don't need bridging, this is an option.

Another solution is to run a local X server in stead, and use X over ssh for your xterms.

Eroen

Posted 2012-03-14T07:10:06.630

Reputation: 5 615

The tip that worked best for me was to just use NAT setup and to use then the static address of the host. I can now write scripts that use that static address only, which will be stable over time. Thank's for your solution! – mliebelt – 2012-03-15T07:01:36.323

1

The easiest is to start Xvnc in server side and use any VNC client to connect. You do not need any X server in your Windows machine. If you do not need Windows itself during the development, it is best to set Xvnc display size the same you are using in your Windows workstation and use full screen mode all times. Except you miss audio, it looks exactly like you are working behind your Linux server. Good thing is that you do not need your own workstation to access it and can use any PC where VNC client can be easily installed. To make it secure, use SSH port forwarding (works also with putty) and make Xvcc listen only loopback IP

Here is how I use that. Add /etc/X11/xdm/Xservers line:

:1 local /usr/bin/Xvnc :1 -localhost -geometry 3840x1200 -depth 24 -desktop banana -wm -dpi 95

Then you can connect to :1 but only from localhost. To connect that remotely, do first SSH to your server with "LocalForward 5901 127.0.0.1:5900" and then open just screen ":1" from your workstation

Cougar

Posted 2012-03-14T07:10:06.630

Reputation: 533

Wow, that sounds interesting. If will definitively give it a try ... – mliebelt – 2012-03-14T08:46:16.767

I gave it a try, but had more problems than expected. Reason for that could be that I am using an Ubuntu server version (no X preinstalled), so I have to fix some of the problems with setting up an X-Server first. To use NAT for VMware solved the problem of changing IP, so I will stop my experiment now. But thank's for a possible solution. – mliebelt – 2012-03-15T07:00:29.100