Create CMD/shortcut to run Cygwin X Program and hide TTY

0

I have successfully setup Virt-Manager on Windows and am looking to streamline the launch as its a bit cumbersum.. (So is the installation...)

Currently the only working way for me to launch Virt-Manager is to login the terminal and then type the following:

startxwin >/dev/null 2>&1 &
virt-manager

I noticed there is a GUI executable in the cygwin folder called XWin.exe, perhaps I can set that to autolaunch Virt-Manager? At this time it is my only use for Cygwin and if I find another use for Cygwin I see me having a separate folder for each purpose.

Note: I tried creating the file .startxwinrc with virt-manager inside, but then when i run startxwin it just fails completely to load virt-manager :(

I created a script with the above code and it works by just logging in and executing ./virtmgr.sh, but the TTY stays open in the background.

I also haven't figured out how to launch that script via CMD/Bat file.

Any Advice is greatly appreciated, thanks!

FreeSoftwareServers

Posted 2018-04-23T04:29:03.350

Reputation: 962

Answers

0

To run Script :

C:\cygwin64\bin\run.exe /usr/bin/bash.exe -l -c /home/Admin/virtmgr.sh

To use .startxwinrc:

End file with sleep inf

How do I prevent Cygwin's XWin Server automatically starting xterm?

My issue with .startxwinrc was the above post, it exits unless you add sleep inf to the autostart file. I was able to get my script to run as well via the above code snippet, and the tty exited after the script.

I did REMOVE the shebang from the script and added entire /full/path/to/binary, but I didn't test if it's needed as I chose to perfect using .startxwinrc. My though was that I called bash via the CLI options so it didn't need the shebang, and I just used full paths in case that was the problem.

FreeSoftwareServers

Posted 2018-04-23T04:29:03.350

Reputation: 962