Start fvwm through Cygwin?

I have installed Cygwin and Fvwm for winXP. I have the opened a shell and typed fvwm2 but then I get this error:

$ fvwm2
[FVWM][CatchRedirectError]: <> another WM is running

it seems that I need to shut down another WM first, any hints on how to run fvwm on winXP through Cygwin?

You have to edit the startxwin.bat script in /usr/X11R6/bin it has a bunch of options in there. Then execute that double click that startxwin.bat file and it will start and X session and fvwm2 for you. It uses a really old verison of fvwm that doesnt support many of the new features. I tred compiling a new version but i could never get it to compile. Hope that helps

VoiDeR

Compiled fine for me.

And creating an .xinitrc file in my homedir with ‘exec fvwm’ in it made startx behave just as expected.

What version did you use BlackDragon?

The latest snapshot at that moment, must have been 2.5.14pre I think…

I just installed fvwm 2.5.14 and it works great so far. Here is a copy of the bat file that i use to launch it

@echo off
SET DISPLAY=127.0.0.1:0.0


REM 
REM The path in the CYGWIN_ROOT environment variable assignment assume
REM that Cygwin is installed in a directory called 'cygwin' in the root
REM directory of the current drive.  You will only need to modify
REM CYGWIN_ROOT if you have installed Cygwin in another directory.  For
REM example, if you installed Cygwin in \foo\bar\baz\cygwin, you will need 
REM to change \cygwin to \foo\bar\baz\cygwin.
REM 
REM This batch file will almost always be run from the same drive (and
REM directory) as the drive that contains Cygwin/X, therefore you will
REM not need to add a drive letter to CYGWIN_ROOT.  For example, you do
REM not need to change \cygwin to c:\cygwin if you are running this
REM batch file from the C drive.
REM 

SET CYGWIN_ROOT=\cygwin

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

SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
SET XNLSPATH=/usr/X11R6/lib/X11/locale


REM
REM Cleanup after last run.
REM

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


REM
REM The error "Fatal server error: could not open default font 'fixed'" is
REM caused by using a DOS mode mount for the mount that the Cygwin/X
REM fonts are accessed through.  See the Cygwin/X FAQ for more 
REM information:
REM http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-error-font-eof
REM

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

REM Windows 95/98/Me
echo startxwin.bat - Starting on Windows 95/98/Me

goto STARTUP

:OS_NT

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

:STARTUP

REM Brief descriptions of XWin-specific options:
REM
REM -screen scr_num [width height]
REM      Enable screen scr_num and optionally specify a width and
REM      height for that screen.
REM      Most importantly, any parameters specified before the first -screen
REM      parameter apply to all screens.  Any options after the first -screen
REM      parameter apply only to the screen that precedes the parameter.
REM      Example:
REM          XWin -fullscreen -screen 0 -screen 1 -depth 8 -screen 2
REM      All screens will be fullscreen, but screen 2 will be depth 8, while
REM      screens 0 and 1 will be the default depth (whatever depth Windows
REM      is currently running at).
REM -multiwindow
REM      Start an integrated Windows-based window manager.  Not to be used
REM      with -rootless nor -fullscreen.
REM -rootless
REM      Use a transparent root window with an external window manager
REM      (such as twm).  Not to be used with -multiwindow nor
REM      with -fullscreen.
REM -fullscreen
REM      Use a window as large as possible on the primary monitor.
REM -multiplemonitors
REM      Create a root window that covers all monitors on a
REM      system with multiple monitors.
REM -clipboard
REM      Enable the integrated version of xwinclip.  Do not use in
REM      conjunction with the xwinclip program.
REM -depth bits_per_pixel
REM      Specify the screen depth to run at (in bits per pixel) using a
REM      DirectDraw-based engine in conjunction with the -fullscreen
REM      option, ignored if the -fullscreen option is not specified.
REM      By default, you will be using a DirectDraw based engine on any
REM      system that supports it.
REM -unixkill
REM      Trap Ctrl+Alt+Backspace as a server shutdown key combination.
REM -nounixkill
REM      Disable Ctrl+Alt+Backspace as a server shutdown key combination (default).
REM      Example:
REM          XWin -unixkill -screen 0 -screen 1 -screen 2 -nounixkill
REM      Screens 0 and 1 will allow Ctrl+Alt+Backspace, but screen 2 will not.
REM -winkill
REM      Trap Alt+F4 as a server shutdown key combination (default).
REM -nowinkill
REM      Disable Alt+F4 as a server shutdown key combination.
REM -scrollbars
REM      Enable resizing of the server display window.  Do not use in conjunction
REM      with -multiwindow nor with -rootless.
REM -nodecoration
REM      Draw the server root window without a title bar or border.
REM      Do not use with -mutliwindow nor with -rootless.
REM -lesspointer
REM      Hide the Windows mouse cursor anytime it is over any part of the
REM      window, even if Cygwin/X is not the window with the focus.
REM -refresh rate_in_Hz
REM      Specify a refresh rate to use when used with the -fullscreen option.
REM -trayicon
REM      Enable the tray icon (default).
REM -notrayicon
REM      Disable the tray icon.
REM      Example:
REM          XWin -notrayicon -screen 0 -screen 1 -screen 2 -trayicon
REM      Screens 0 and 1 will not have tray icons, but screen 2 will.
REM -emulate3buttons [timeout]
REM      Emulate 3 button mouse with an optional timeout in milliseconds.
REM -xf86config
REM      Specify an XF86Config-style configuration file.
REM -keyboard
REM      Specify a keyboard device from the configuration file.


REM
REM Startup the programs
REM


REM Startup the X Server with the integrated Windows-based window manager.
REM WARNING: Do not use 'xwinclip' in conjunction with the ``-clipboard''
REM command-line parameter for XWin.  Doing so would start two clipboard
REM managers, which is never supposed to happen.

run XWin -rootless 
REM -multiwindow -clipboard -silent-dup-error


REM Startup an xterm, using bash as the shell.

run xterm -fg white -bg black -e /usr/bin/bash -l

REM run openbox
REM run xwinwm
run /usr/local/bin/fvwm2

REM
REM Startup the twm window manager.
REM WARNING: Do not use an external window manager in conjunction with
REM the ``-multiwindow'' command-line parameter for XWin.  Doing so
REM would start two window managers, which is never supposed to happen.
REM

REM run twm


REM Set a background color.  Only needed when not using -multwindow for XWin.

REM run xsetroot -solid aquamarine4

I use the file C:\cygwin\usr\X11R6\bin\startxwin.bat to start a xterm. I have used you file to change my own and it now looks like this:

@echo off
SET DISPLAY=127.0.0.1:0.0


REM 
REM The path in the CYGWIN_ROOT environment variable assignment assume
REM that Cygwin is installed in a directory called 'cygwin' in the root
REM directory of the current drive.  You will only need to modify
REM CYGWIN_ROOT if you have installed Cygwin in another directory.  For
REM example, if you installed Cygwin in \foo\bar\baz\cygwin, you will need 
REM to change \cygwin to \foo\bar\baz\cygwin.
REM 
REM This batch file will almost always be run from the same drive (and
REM directory) as the drive that contains Cygwin/X, therefore you will
REM not need to add a drive letter to CYGWIN_ROOT.  For example, you do
REM not need to change \cygwin to c:\cygwin if you are running this
REM batch file from the C drive.
REM 

SET CYGWIN_ROOT=\cygwin

SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%CYGWIN_ROOT%\usr\X11R6\lib;%CYGWIN_ROOT%\lib%PATH%

SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
SET XNLSPATH=/usr/X11R6/lib/X11/locale


REM
REM Cleanup after last run.
REM

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


REM
REM The error "Fatal server error: could not open default font 'fixed'" is
REM caused by using a DOS mode mount for the mount that the Cygwin/X
REM fonts are accessed through.  See the Cygwin/X FAQ for more 
REM information:
REM http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-error-font-eof
REM

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

REM Windows 95/98/Me
echo startxwin.bat - Starting on Windows 95/98/Me

goto STARTUP

:OS_NT

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

:STARTUP

REM Brief descriptions of XWin-specific options:
REM
REM -screen scr_num [width height]
REM      Enable screen scr_num and optionally specify a width and
REM      height for that screen.
REM      Most importantly, any parameters specified before the first -screen
REM      parameter apply to all screens.  Any options after the first -screen
REM      parameter apply only to the screen that precedes the parameter.
REM      Example:
REM          XWin -fullscreen -screen 0 -screen 1 -depth 8 -screen 2
REM      All screens will be fullscreen, but screen 2 will be depth 8, while
REM      screens 0 and 1 will be the default depth (whatever depth Windows
REM      is currently running at).
REM -multiwindow
REM      Start an integrated Windows-based window manager.  Not to be used
REM      with -rootless nor -fullscreen.
REM -rootless
REM      Use a transparent root window with an external window manager
REM      (such as twm).  Not to be used with -multiwindow nor
REM      with -fullscreen.
REM -fullscreen
REM      Use a window as large as possible on the primary monitor.
REM -multiplemonitors
REM      Create a root window that covers all monitors on a
REM      system with multiple monitors.
REM -clipboard
REM      Enable the integrated version of xwinclip.  Do not use in
REM      conjunction with the xwinclip program.
REM -depth bits_per_pixel
REM      Specify the screen depth to run at (in bits per pixel) using a
REM      DirectDraw-based engine in conjunction with the -fullscreen
REM      option, ignored if the -fullscreen option is not specified.
REM      By default, you will be using a DirectDraw based engine on any
REM      system that supports it.
REM -unixkill
REM      Trap Ctrl+Alt+Backspace as a server shutdown key combination.
REM -nounixkill
REM      Disable Ctrl+Alt+Backspace as a server shutdown key combination (default).
REM      Example:
REM          XWin -unixkill -screen 0 -screen 1 -screen 2 -nounixkill
REM      Screens 0 and 1 will allow Ctrl+Alt+Backspace, but screen 2 will not.
REM -winkill
REM      Trap Alt+F4 as a server shutdown key combination (default).
REM -nowinkill
REM      Disable Alt+F4 as a server shutdown key combination.
REM -scrollbars
REM      Enable resizing of the server display window.  Do not use in conjunction
REM      with -multiwindow nor with -rootless.
REM -nodecoration
REM      Draw the server root window without a title bar or border.
REM      Do not use with -mutliwindow nor with -rootless.
REM -lesspointer
REM      Hide the Windows mouse cursor anytime it is over any part of the
REM      window, even if Cygwin/X is not the window with the focus.
REM -refresh rate_in_Hz
REM      Specify a refresh rate to use when used with the -fullscreen option.
REM -trayicon
REM      Enable the tray icon (default).
REM -notrayicon
REM      Disable the tray icon.
REM      Example:
REM          XWin -notrayicon -screen 0 -screen 1 -screen 2 -trayicon
REM      Screens 0 and 1 will not have tray icons, but screen 2 will.
REM -emulate3buttons [timeout]
REM      Emulate 3 button mouse with an optional timeout in milliseconds.
REM -xf86config
REM      Specify an XF86Config-style configuration file.
REM -keyboard
REM      Specify a keyboard device from the configuration file.


REM
REM Startup the programs
REM


REM Startup the X Server with the integrated Windows-based window manager.
REM WARNING: Do not use 'xwinclip' in conjunction with the ``-clipboard''
REM command-line parameter for XWin.  Doing so would start two clipboard
REM managers, which is never supposed to happen.

run XWin -multiwindow -clipboard -silent-dup-error


REM Startup an xterm, using bash as the shell.

run xterm -e /usr/bin/bash -l


REM
REM Startup the twm window manager.
REM WARNING: Do not use an external window manager in conjunction with
REM the ``-multiwindow'' command-line parameter for XWin.  Doing so
REM would start two window managers, which is never supposed to happen.
REM

REM run fvwm2



REM Set a background color.  Only needed when not using -multwindow for XWin.

REM run xsetroot -solid aquamarine4

in my homedir I have the following files:

.xinitrx

#exec fvwm2 -f /usr/X11R6/share/fvwm/system.fvwm2rc-sample-95
#exec fvwm2
exec fvwm2
#exec openbox
#ssh-agent wmaker > ~/.ssh-agent
#export DISPLAY=localhost:0
#xhost +

.xserverrc

exec X :0 -clipboard

.Xresources

XTerm.VT100.font:           -*-lucidatypewriter-medium-*-*-*-14-*-*-*-*-*-*-*
XTerm.VT100.boldFont:       -*-lucidatypewriter-bold-*-*-*-14-*-*-*-*-*-*-*
XTerm.VT100.scrollBar:      True
XTerm.VT100.visualBell:     True
XTerm.VT100.loginShell:     True
XTerm.VT100.background:     Black
XTerm.VT100.foreground:     White

I am not sure if all are necessary. But when I run startxwin.bat and type “startx” I get this error:

mos@mos-5a13658e594 /home
$ startx

Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 6.8.2.0-4

Contact: mailto:cygwin-xfree@cygwin.com

XWin was started with the following command line:

X :0 -clipboard

_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
winValidateArgs - g_iNumScreens: 1 iMaxConsecutiveScreen: 1
winCheckDisplayNumber - Cygwin/X is already running on display 0

Fatal server error:
InitOutput - Duplicate invocation on display number: 0. Exiting.

winDeinitMultiWindowWM - Noting shutdown in progress
giving up.
xinit: Connection reset by peer (errno 104): unable to connect to X server
xinit: No such process (errno 3): Server error.

mos@mos-5a13658e594 /home
$

Hope someone hs any ideas!

I made an error in the filename for startxwin.bat

Now I don’t get the error from before.

But I just get a window in my taskbar that won’t maximize and when I press it there comes a small edge around the screen as if something should have appeared.

All i do to start an xsession is double click on startxwin.bat in the /usr/X11R6/bin directory. If you do that you dont need to use startx because X is alread started. It sound like you have X running because you get the icon and the boarder thing. Do you have a fvwm config file in you your home directory?

Back up your /usr/X11R6/bin/startxwin.bat file and use this one instead

@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
SET XNLSPATH=/usr/X11R6/lib/X11/locale

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 startxwin.bat - Starting on Windows 95/98/Me
goto STARTUP

:OS_NT
echo startxwin.bat - Starting on Windows NT/2000/XP/2003

:STARTUP
run XWin 
REM -multiwindow -clipboard -silent-dup-error

run xterm -fg white -bg black -e /usr/bin/bash -l
run /usr/local/bin/fvwm2
run xsetroot -solid aquamarine4

This will open fvwm in its own window with a aqua blue desktop.

YES!!! I works!! After 3 days living only on coffee! Thank you so much! :slight_smile:

:smiley: Its a pain to set up but ill tell you i dont think i could live with out it. My next step is to try and get ssh server running so i can connect to my windows box from anywhere.

VoiDeR