Running Bochs remotely to a local Windows machine

Thanks to Shadan Haghani for writing this up.

Setting up Cygwin, X, and Secure Shell

First things first, Cygwin/X-server must be installed and running on your machine, and you must have an SSH client installed. A reasonable free X server for Cygwin is XFree 86. F-secure is a good SSH client and it can be downloaded for free on the OIT website. To test if the x-server is running, ssh into your linuxlab account and type the command

  xclock &
at the prompt. If a separate window with a clock pops up, then X-server is running on your machine. If you get any error like "can't connect to server" or "can't open display", then X-server is not running on your machine or you haven't enabled X11 tunneling in your SSH client. Make sure you have X11 tunneling enabled in your SSH client otherwise you won't be able to open multiple windows.

Installing the Fonts

Next, the fonts folder has to be saved on your local machine, where you have Cygwin running. It might not have to be in the Cygwin folder, but it is better to put it there for organization purposes anyway. I unzipped my fonts folder to C:/cygwin/font.

Next, run the xset command from your linuxlab account. When you run the xset command, xset fp+ path to fonts.dir, the path refers to a path on your local machine. It has to be the path Cygwin recognizes. To see what I mean, use a cygwin Xterm window to navigate through your directory to the fonts.dir file. The file path you see at the prompt is the path that needs to be given in the xset command. For the directory I unzipped my fonts to, the path is /cygdrive/c/cygwin/font. If you get error #58 after you run the xset command, it pretty much means that the fonts.dir file wasn't in the path you specified.

Running Bochs

If you've completed all the above steps, bochs should be able to run (that is, build your project on Linuxlab, and run bochs from the build as described in the project posting). You have to build the simulator only once, but you have to set the PATH environment variable and execute the xset command every time you login. If you already have done this, go to your build folder and start the simulator. If you get the error "cannot connect to x-server", then X-windows is not running on your machine. If you get the error "cannot find VGA font", then the fonts.dir file doesn't have the font that Bochs is looking for.

If the fonts.dir file that you specified is the right one, and you still get the "cannot find VGA font" error, you might have to run the command

  makefontdir path to fonts.dir
on your font directory. The command has to be run locally from a cygwin xterm. I'm not sure why, but I had to do this on my home computer but not on my laptop. In fact, I get an error when I try to run it on my laptop. Who knows how these things work?