Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What has happened to startx on Cygwin?

Tags:

cygwin

xterm

I just had my desktop computer replaced. Both my previous computer and this one have Windows XP. In order to work with the many Linux servers we have, I installed Cygwin along with its xterm package. However, I cannot run startx to start the X-window server as I did with my previous computer. I've been looking online to see why startx is missing from my install, but I haven't found anything yet. Any help would be greatly appreciated.


[Does more research] Well, I just installed the xinit package, which I do not recall having to do before. (It may have been a requirement for the xterm package the last time I installed Cygwin.) startx now exists, but I wouldn't say it works. The X-window server it starts creates a window that covers my entire monitor with three terminals within it, unlike the old 25 line x 80 column single terminal window I'm used to. Worse, I can't just spawn child windows like I used to, which was the real power of using Cygwin with X-windows.

like image 729
DLJessup Avatar asked Feb 05 '09 02:02

DLJessup


People also ask

How do I start XWin?

Start the X server using the "XWin Server" shortcut under "Cygwin-X" on the Start Menu. (See the Section called Starting in multiwindow mode (startxwin) in Chapter 3 for more details). 3. Start X clients using the "X applications menu" icon in the notification area, or from the command line.

How do I install XWin?

All you need to do is to click on your Windows' Start Menu, scroll down to the C section and look for Cygwin-X folder, click on it, and look for the "XWin Server" icon. It may look something like the following: Drag the "XWin Server" icon onto your desktop and you are all set!

What is Startxwin?

The startxwin script is a front end to xinit(1) that provides a somewhat nicer user interface for running a single session of the X Window SystemWindow SystemIn computing, a windowing system (or window system) is software that manages separately different parts of display screens. It is a type of graphical user interface (GUI) which implements the WIMP (windows, icons, menus, pointer) paradigm for a user interface.https://en.wikipedia.org › wiki › Windowing_systemWindowing system - Wikipedia in multiwindow mode. It is often run with no arguments. Arguments immediately following the startxwin command are used to start a client in the same manner as xinit(1).


2 Answers

OK, after doing more research and getting help from one of my coworkers, I have found a solution to my problem.

What has happened is that, although startx exists, it now starts the X server in fullscreen mode by default instead of multiwindow mode. Looking back, I probably could have copied /etc/X11/xinit/xinitrc to ~/.xinitrc and customized it. However, it turns out that there are other startup scripts for the X server which are easier to modify. (See http://x.cygwin.com/docs/ug/using.html.)

In this case, I took the script startxwin.bat. I then made a couple of changes to startxwin.bat:

  • I added a drive letter to the CYGWIN_ROOT because my work environment has my home directory outside of the C drive.
  • I added a "+tb" option to the xterm call to suppress the menubar at the top of the X-window.

The nifty thing is that by going to Start → Programs → Cygwin-X → Xwin Server, I can open a GUI Cygwin X-window without ever opening the standard Cygwin command line. This was decidedly not the case with my previous installation.

I should add that I made these changes after expanding my selection of packages. Instead of just installing X11 → xterm, I followed the recommendations in step 15 of http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html and installed:

  • X11 → X-start-menu-icons
  • X11 → xinit
  • X11 → xorg-docs
  • X11 → xorg-server

(This selection picked up X11 → xterm as a required package.) While I see no obvious reason why the directions above wouldn't have worked with just X11 → xterm and X11 → xinit installed, I haven't put that theory to the test, and I have little desire to blow away my current installation and rebuild it to prove my theory.

I hope this helps other people avoid some pain.

like image 137
DLJessup Avatar answered Jan 04 '23 08:01

DLJessup


Disclaimer: I know this answer does not answer your question directly, but it offers a good alternative.

I use Cygwin + XMing to run remote X applications:

  1. Launch XMing
  2. Start my favorite Cygwin shell (zsh)

    export DISPLAY=localhost:0
    ssh -X myserver.domain
    
  3. Run X programs

Works like a charm. The best part is that XMing can neatly integrate X windows into the Windows GUI, i.e. each X app has its own full-right window.

like image 33
David Hanak Avatar answered Jan 04 '23 09:01

David Hanak