What has happened to startx on Cygwin? - cygwin

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.

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.

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:
Launch XMing
Start my favorite Cygwin shell (zsh)
export DISPLAY=localhost:0
ssh -X myserver.domain
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.

Thanks, this helped me a bit (finding out about installing xinit). That new startx window was really crappy, a friend helped me solve it in another way: by starting with: startxwin.sh instead of startx. Then it looked like the "old" one, and worked much better.

When you installed Cygwin, did you install the full package set? The default is to only install a baseline of packages which may not include X.
Run setup.exe again and ensure the X11 packages are installed. I just click on the little double arrows next to "All" until it says "Install". It may be you chose "Default" instead.
It's better to have a full install since I remember having problems with Cygwin dependencies in the past and now, when I run 'Start', 'All Programs', 'CygWin-X', 'XWin Server', it runs fine, opening up one shell, then 'xterm &' opens another shell.
So I really think you need to install the lot. You could try, at a bare minimum, the whole X11 group (not just xinit) but you may as well do the lot, especially given the powerful commands you get.

I always run Cygwin install twice ... the first time, I just install default packages, and the second time, I install EVERYTHING. The download takes forever, but in this way I always have almost everything I could possibly want. (I like how on Cygwin I can install everything and there are no conflicts, unlike some Linux distributions where there are packages that do the same thing in different ways which can't be installed at the same time. But of course Cygwin has an easier job of this than a full OS ... there's no Cygwin sendmail, for example.)
I have to install Cygwin on a new machine tomorrow, so this question freaks me out. I'm going to die if startx isn't working. I hope it turns out that you're just missing a package. I highly recommend installing everything.

Related

StartX failing to run:- Arch linux openbox

I am a linux noob trying to setup openbox on an arch linux base. I am trying to get it as lightweight as possible in terms of resources used.
My final plan is to use openbox, with tint1 and conky.
however I am having an issue getting openbox to start. I have followed numerous guides and am struggling to figure out the problem.
I have so far installed the following (and done this config)
openbox (installed default option with the extras asked for)
create ~/.conifg/openbox
copied, rc.xml, menu.xml, autostart, environment to the above location
pyxdg
xorg-xinit
xorg-server
this didn't work so I the installed the full
xorg
still nothing, although when I try to run startx the screen goes black for a second as though it is trying, but then goes back to text mode saying it has failed.
I have had a look at the attached log file, but I don't know enough to be able to interpret it properly.
log file: https://www.dropbox.com/s/r76fowkooi822y9/Xorg.log?dl=0
I would appreciate any assistance.
Thanks
Steve
still nothing, although when I try to run startx the screen goes black for a second as though it is trying, but then goes back to text mode saying it has failed.
what is it saying?
There is only one error: (EE) open /dev/fb0: Permission denied, try starting your environment with the same configuration as root - just to see if it works. Maybe its a problem related to rootless X.
Have you configured/checked your installation (xserver, graphics driver, xinit config) using the following guides?
https://wiki.archlinux.org/index.php/xorg
https://wiki.archlinux.org/index.php/xinitrc
Try to start a minimal X (As described in the xinitrc article) to see if your xserver and graphics driver is working correctly.

Cygwin Terminal shell stopped working properly

cygwin64 had been running great on my Windows 7 system for several months. After rebooting this morning, it appeared to be inexplicably broken. When I started a new mintty session, rather than presenting a window with my familiar bash prompt, I got a blank window entitled -sh.exe. Sure enough, despite the lack of any sort of prompt, it was a shell window. ls, pwd, cd, and other commands worked, but my environment was a mess. Aside from the lack of a prompt, my home directory, path, and other things were messed up.
I tried the normal things. I reran cygwin setup to no avail. I completely uninstalled and reinstalled cygwin, again with no discernible effect. I rebooted a number of times during all these tries. What could cause cygwin to suddenly begin behaving so badly?
I had similar issues after installing IBM InfoSphere DataStage, which causes Cygwin to misbehave because it is setting several Windows environment that are inherited by Cygwin, and are crucial to Mintty and the shell. These variables are: SHELL, TERM, TERMCAP, and TERMINFO.
I modified my Mintty shortcut to contain the following target, and this fixed the issues:
C:\cygwin\bin\mintty.exe /bin/env -u SHELL -u TERMCAP -u TERMINFO - TERM=xterm-256color HOME=/home/username /bin/bash -i -l
The -u options are unsetting those variables, and then I'm explicitly setting TERM and HOME (make sure to use your home directory instead of /home/username).
I also had to copy my ~/.minttyrc file to /etc/minttyrc so that mintty would see it.
After digging around, I noticed that the sh.exe that was running was not in /cygwin64/bin, but was instead in \Program Files (x86)\MKS Toolkit. I did not recall installing MKS, but the date on this directory was from the previous day. The only thing I'd recently installed was the IBM InfoSphere DataStage client. It turns out, InfoSphere not only installs the MKS Toolkit, it prepends it to a number of environment variables, totally hosing cygwin.

How do i resolve the procedure entry point_impure_ptr error in cygwin/opencobol?

Whenever I try to run my .exe cobol file, i get this error..
fileName.exe Entry Point Not Found
The procedure entry point_impure_ptr could not be located in the dynamic link library cygwin1.dll
I am using OpenCObol and cygwin ver1.7.15.thanks
You'll need to specify the proper path for the command below, but Cygwin seems pretty persnickety with entry point addresses and updates, The system includes a rebaseall command to help fix this problem. Most times I've witnessed it is after a setup.exe pass, while the Cygwin system was still active (and perhaps only in the background and not visible).
C:\Users\btiffin\cygwin\bin\dash -c '/usr/bin/rebaseall'
Run that from a Windows CMD shell (while Cygwin isn't active, say after a clean boot and before running the Cygwin shell. Basically cygwin1.dll can't be open). You'll need to use the proper Windows path to dash for your particular install. Google Cygwin rebase for detailed articles.
I had a similar error message after upgrading from cygwin version 1.5 to 1.7. I solved it by completely removing and reinstalling 1.7 from scratch. I was told there might have been a problem with multiple versions of dlls.

Installing perforce visual client on linux

I am from Mac background trying my hand at installing perforce client visual(P4V) on my linux box.For this I download the correct version here and untar the files.
Then I cd to the directory
~/Desktop/p4v-2012-blah-blah/bin
I also say
chmod +x p4*
After this i try running p4v (by double clicking) but I dont see anything .The file type is shown as a "text executable" but i dont know why it is not running.
On mac i had done the same thing -just clicked on p4v and the client would show up(where I filled the server address and everything )But not sure what is going wrong here.Can someone give me directions?
FWIW i did check out this link
and I do see the desktop (so GNOME is probably installed ?) .Hence p4v should be able to run.
I know we don't like link-based answers, but there is a rather complete walk-through here: http://www.perforce.com/documentation/tenminute-test-drive-linuxunix
Probably should be on Super User though.
You may have a 64bit Linux and tried to install a x86 P4V or vice versa, which is why the command doesn't run. Check that the OS and app types match.

Cygwin content disappear issue

I am working on an Android App and just start to use Cygwin for ndk-build. When I build my c lib, the output may disappear while scrolling down fast. The same will happen when I try to make other libraries based on Linux through Cygwin. Although I can reopen the cmd window and make the project again to see the output that really matters, such as, warnings, errors, but it's really annoying to do it again and again.
Does someone encounter the same question? How to solve it?
Thanks.
What terminal are you using? By default cygwin just runs bash under the usual windows cmd.exe, which is definitely not all that great; installing and using mintty (simplest way to do so is through cygwin's setup.exe) and setting the scrollback buffer size to accommodate your needs should fix the problem.
You could use other terminals too- PuTTY, xterm, rxvt, etc (even the KDE and Gnome terminals are available through Cygwin Ports)- but mintty is probably the best option for most cygwin users' needs (it's rather simple, small, and fast, and it integrates well with Windows).
Another option would be to redirect compilation messages: use > to redirect stdout to a file, overwriting it if it already exists, >> to append, and add a & if you want both stdout and stderr redirected, e.g. gcc mysource.c &>compilelog.

Resources