couldn't initialize OpenGL, expect problems

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

couldn't initialize OpenGL, expect problems

Post by flameout »

Hi
I am trying to run a game server on a VPS. If I SSh onto the VPS (Debian 7) I can run the game server using wine. The problem is I cannot end SSH session or else program terminates. I have tried running it using a VNC connection but then I get this error:

err:wgl:X11DRV_WineGL_InitOpenglInfo couldn't initialize OpenGL, expect problems
err:d3d_caps:WineD3D_CreateFakeGLContext Can't find a suitable iPixelFormat.
err:d3d:InitAdapters Failed to get a gl context for default adapter
Direct3D10 is not available without OpenGL.

Because this is a VPS it does not have a graphics card. All suggestions welcome thanks
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: couldn't initialize OpenGL, expect problems

Post by L. Rahyen »

flameout wrote:If I SSh onto the VPS (Debian 7) I can run the game server using wine. The problem is I cannot end SSH session or else program terminates.
Then do not end it, or run the game server in background. Some examples. To run a command in background (you can put this into some startup script if you want to start it automatically):

Code: Select all

command &> /tmp/log.txt& disown
Never ending ssh session is another solution. This is possible even if your Internet connection is not stable if you use screen. For example, this is the script I use to ssh to my own server (to install it, save it to file /usr/local/bin/ssh_screen and then run "sudo chmod +x /usr/local/bin/ssh_screen"):

Code: Select all

#!/bin/bash
export SCREEN_NUMBER="$2"
export SERVER_USERNAME="$(echo $1 | cut -d@ -f1)"
export SERVER_DOMAIN="$(echo $1 | cut -d@ -f2)"
while true; do
  ssh -C -t "$SERVER_USERNAME@$SERVER_DOMAIN" screen -h 10000 -D -R "$(whoami).$SERVER_USERNAME.$SCREEN_NUMBER";
  sleep 2;
done
Then you will be able to login like this:

Code: Select all

ssh_screen [email protected] 0
Where zero is unique name of ssh_screen session. You can use this name to later access it. Instead of zero, you can use other numbers or strings as unique session name. You can have multiple ssh_screen sessions on your server. Read more about screen and how to install it here: https://www.howtoforge.com/linux_screen . You also may want to setup passwordless login so it can reconnect automatically: http://linuxconfig.org/passwordless-ssh . Everything in screen session will continue to work even if you are not connected. If you do not want to reconnect automatically, remove "while true; do" and "sleep 2; done" parts.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

Hi

I have already tried using screen without much luck. It seemed like the output from wine was ignored by the screen functionality?
I will try the methods that you have suggested and see how they work.
Thank you
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: couldn't initialize OpenGL, expect problems

Post by L. Rahyen »

Not sure what you mean by "output from wine was ignored by the screen functionality". But so far everything that worked in normal ssh session always worked for me in ssh_screen session. If something goes wrong with any methods I gave you please let me know and I will try to help.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

Sorry if I have multiple posts the same.. suddenly having connection problems
Okay tried the first method, it did not work. The wine screen opened in foreground and closed when I disconnected from ssh.
I dont understand your second method. It looks as if this is happening on your local machine??
I am connecting to a remote server using SSH.
What I meant by the 'screen' statement was that my ssh screen was saved and I could see it when I re-connected but the console window which was opened by the program running under wine seemed to be outside of what 'screen' could detect. When I closed the SSH connection that console closed and did not open when I re-connected
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: couldn't initialize OpenGL, expect problems

Post by L. Rahyen »

flameout wrote:Sorry if I have multiple posts the same.. suddenly having connection problems
First few posts of new users need to be approved by moderator, after that your posts will appear immidiately.
flameout wrote:Okay tried the first method, it did not work. The wine screen opened in foreground and closed when I disconnected from ssh.
First method does not need screen, it should work from normal ssh session or even startup script. If it opened in foreground, then this is why it did not work. I tested it in bash and zsh, so it is strange that it did not work. You could try this instead:

Code: Select all

command& disown
It should work from normal ssh session. If still does not work as expected, please post full command you are trying to run (if in your command you have sensitive information like username or password, just replace it with something like "xxx") and what shell you are using (run "$SHELL --version" on your server if not sure).
I dont understand your second method. It looks as if this is happening on your local machine??
1) On local machine you need to create /usr/local/bin/ssh_screen script as described in my previous post.
2) Then on the server you need to have screen command installed.
3) After this you should be able to login to your server like this:

Code: Select all

ssh_screen [email protected] 0
Zero in this example is ssh_screen session name, it can be any other name instead (for example, "session_name" instead of "0"). Later (for example, after reboot of your local machine) you should be able to reconnect to the same ssh_screen session on your server by running the same command (while it is running it will try reconnect automatically).
I am connecting to a remote server using SSH.
As you can see using my ssh_screen script is very similar to using ssh, just instead of "ssh [email protected]" you need to run something like "ssh_screen [email protected] 0".
What I meant by the 'screen' statement was that my ssh screen was saved and I could see it when I re-connected but the console window which was opened by the program running under wine seemed to be outside of what 'screen' could detect. When I closed the SSH connection that console closed and did not open when I re-connected
I still do not understand, especially "outside of what 'screen' could detect" part. I suggest you to try my script instead. You can check what screen sessions you have on your server by running "ps ax | grep screen". If you still have issues, please post commands you are trying to run, and, if necessary, screenshots or terminal output.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

As you can tell I am a complete linux novice.
Okay this is what I have worked out. The program running under wine is opening a console screen which is being sent to my local pc via x11. It is this x11 screen which seems to be outside of the 'screen' session and gets lost.
If I turn x11 off and try your second method then I get these errors:
connect /tmp/.X11-unix/X0: Connection refused
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:systray:initialize_systray Could not create tray window
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
err:d3d_caps:WineD3D_CreateFakeGLContext Failed to create a window.
err:d3d:InitAdapters Failed to get a gl context for default adapter
Direct3D10 is not available without OpenGL.

Just by the way I am using a Windows PC locally and for SSH using MobaXterm
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: couldn't initialize OpenGL, expect problems

Post by L. Rahyen »

flameout wrote:The program running under wine is opening a console screen which is being sent to my local pc via x11. It is this x11 screen which seems to be outside of the 'screen' session and gets lost.
...
I am using a Windows PC locally and for SSH using MobaXterm
OK, now I understand. Your game server is not really command-line application you can run in normal ssh session, and requieres Direct3D to work (with Wine that means you need X11 server with OpenGL). Since you are using non-Linux OS on your local computer and have unstable Internet connection, this complicates things farther.

I think what you really need is to run OpenGL in VNC server. Normally, I use x11vnc to achieve this. However, if your server does not have video card at all, this will not help you. This is what I have found so far: http://unix.stackexchange.com/questions ... ian-wheezy
Donovan Baarda from stackexchange.com wrote:The problem is the two most common vnc-servers tightvncserver and vnc4server are both x-proxy servers with their own internal x-server that doesn't support GLX. You can still make 3D applications work with them, but you need to use old-school app-server side software rendering, which means you need libgl1-mesa-swx11 installed on your app-server
I checked the solution above on my own server. First, I have tried to run glxgears in remote VNC server and got error about missing GLX extension, which means OpenGL applications will not work. To solve this, I ran on my server:

Code: Select all

sudo apt-get install libgl1-mesa-swx11 libgl1-mesa-swx11:i386
Then I was able to run glxgears and even Windows version of Blender (with Wine) in remote VNC server. Please note that without video card the best you can get is software OpenGL, and it will be slow.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

Hi
Thanks for the help.
When the game server runs it opens a console window which is just a tex 'log' style output. In Windows it looks like a standard console window except it has a white background with black text. I am assuming now that this window is some sortof directx console window.
I did try VNC but then had the problem with the missing opengl.
I will try your suggested method and hopefully it will work.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

IT WORKS :)
Thank you very much. I have spent hours trying to get this working.
It is not a problem if the software opengl is slow because it is just a log output. The game server writes log files so this output is not required but there is no way to turn it off :(
Thanks again.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

So it seems as if this was the easy part. There is an admin application that links to the game server which requires dotnet. I have tried using wine tricks but it has become a nightmare. Winetricks has suggested that I need to download and install various apps but I am no closer. It might be due to the fact that I am using the latest winetricks with an old wine??? I am using wine 1.4.1 which I know is old. But for a linux novice using Debian upgrading wine is a nightmare. The Debian download page seems to be for the unstable version. Where will I find the latest stable version for Debian? Also this link goes nowhere: http://wiki.winehq.org/HowTo
If I was to start over which Linux Distro would be the best to use to get dotnet up and running?
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: couldn't initialize OpenGL, expect problems

Post by L. Rahyen »

flameout wrote:So it seems as if this was the easy part. There is an admin application that links to the game server which requires dotnet. I have tried using wine tricks but it has become a nightmare. Winetricks has suggested that I need to download and install various apps but I am no closer. It might be due to the fact that I am using the latest winetricks with an old wine??? I am using wine 1.4.1 which I know is old.
Since you did not post what commands you ran and what terminal output you got, or even what .NET version you were trying to install with what winetricks version, I cannot tell what issues you are having. I can do some guesses, but please in future do not forget to post commands which did not work as you expected and terminal output.
flameout wrote:Where will I find the latest stable version for Debian?
Latest stable version of Wine is 1.6, and it is in stable Debian repository. By the way, your Debian version is not stable anymore, it is oldstable. Current stable release is Debian 8.1 (Jessie). Please keep in mind that 1.6 is old too. "Stable" usually means no or very small chances of regressions at the cost of more bugs and less features. Using stable Wine is OK if it works for you, but if not, it is a good idea to upgrade.
flameout wrote:If I was to start over which Linux Distro would be the best to use to get dotnet up and running?
Debian is definitely good enough, especially if you upgrade it. Personally, I use it on my server and on all my local computers. For novices something like Mint or Ubuntu/Kubuntu may be a better choice (they all are Debian-based), but since you are not using Linux locally, I do not think there will be much difference in your case, but it is up to you if you want to continue use Debian or try some other distro.

Since you are new to Wine, I'm going to describe some possibilities. There are multiple ways to get newer Wine:
0) You could try 1.6 (wine package) or 1.7.29 (wine-development package) from stable Debian repositories. In case one of these versions is good enough for your applications, you do not need newer Wine version. If you do not mind upgrading from oldstable to Debian stable, please read this: http://linuxconfig.org/how-to-upgrade-d ... le-release . Alternatively, after changing /etc/apt/sources.list to Debian stable repositories, you may try to upgrade only Wine (by running after changing sources.list "sudo apt-get update && sudo apt-get install wine-development"), without upgrading whole system.
1) Build Wine yourself. Most flexible way, but it is hard for novices and you may encounter unexpected issues with very old OS.
2) Find .deb package repository with binary packages. Most repositories are for Ubuntu, however, in my experience, they are usually compatible with Debian, but if you have old Debian version, there are higher chances of encountering compatibility problems.
3) Try Wine Staging instead of plain Wine. Please note that Wine Staging is not officially supported here, also it may have issues not present in plain Wine. The reason why I mention it is because they have repository for Debian 7 (Wheezy): https://github.com/wine-compholio/wine- ... ian-wheezy . This may be an easiest option in your case, unless you encounter unexpected issues. After adding their repository, if you install it with "sudo apt-get install wine-staging-compat", it will replace plain Wine on your system, but if you install it with "sudo apt-get install wine-staging" you have to use "/opt/wine-staging/bin/wine" instead of "wine" when you want to run something with it (this is useful so you can have both plain Wine and Wine Staging on your system).
4) There also many third-party Wine wrappers. For example, PlayOnLinux can manage different Wine versions, also it offers GUI to install optional components including .NET, but PlayOnLinux is not officially supported here. Also, I have seen cases when something works in plain Wine but fails in PlayOnLinux, even when using similar Wine version, so if you decide to try this wrapper and encounter any problems, you have to either ask help on their forum or revert to plain Wine. On the other hand, if all goes smoothly, it may be an easy option. But I do not know if they support oldstable Debian.

In all these cases it may turn out that you do not really need .NET and installing Mono may be enough (Mono is supported since 1.5.3, so it will not work with 1.4). Also, you may want to upgrade winetricks too, if your current version is very old.

Personally, I recommend you to try #3 first because adding a repository and trying it out is relatively fast and easy. But if it will not work out as expected, you probably have to try something else, for example, #0.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

Thanks for the help. Unfortunatly I thought that the install with winetricks would be automatic so at the time I did not take note of the things it asked me to install but at a certain stage it started to become a bit much and thats when I thought of asking the question here.
I tried wine staging and dotnet4 installed but when I try run my program I get this error:
err:module:import_dll Library mscoree.dll (which is needed by L"C:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\mscorsvw.exe") not found

Yes I know that I should now join the wine staging forum :( but a Google search shows that people using Wine also get this problem. I tried running the dotnet cleaner and re-installed but that did not help
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: couldn't initialize OpenGL, expect problems

Post by L. Rahyen »

Are you using 64-bit Wine prefix? If yes or not sure, then it is a good idea to start over with fresh 32-bit Wine prefix (according to AppDB https://appdb.winehq.org/objectManager. ... &iId=17886 32-bit Wine prefix is necessary for .NET 4 to work):

Code: Select all

mv ~/.wine ~/.wine.old
export WINEARCH=win32
wineboot
Then install your application. First, see if it runs with Mono (without .NET). If not then install .NET:

Code: Select all

wget http://winetricks.googlecode.com/svn/trunk/src/winetricks
bash winetricks -q dotnet40 corefonts
You did not say if you installed wine-staging-compat or wine-staging. Please note that winetricks uses default wine command, so if you want it to work with Wine Staging you need "apt-get install wine-staging-compat" (winetricks may not work properly if you still have ancient Wine 1.4 as default wine command, check by running "wine --version" if not sure).
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

I used wine-staging-compat. I tried all of the above but did not help. Wine Staging spends a lot of time complaing about lack of screen card. I am going to 'try' remove staging.
I came accross page which shows how to get the program that I am trying to run working on Linux as a pure console app using just mono. So after getting rid of staging I will try that.
Thank you very much for all of the time you have spent helping me, I do appreciate it.
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Re: couldn't initialize OpenGL, expect problems

Post by L. Rahyen »

It's strange that .NET still did not work for you, before suggesting Wine Staging repository I tested it in remote VNC server (no videocard either), both software OpenGL and .NET 4 installation worked, and I was able to run an application that required .NET 4. I cannot tell why it did not work for you without seeing your terminal output.

Anyway, hope you can get your application working with Mono, if you succeed, please share link to the page you came across so others who encounter similar problem could find the solution in this thread. In case you still need help feel free to ask more questions.
flameout
Level 2
Level 2
Posts: 10
Joined: Sat Jun 27, 2015 7:25 am

Re: couldn't initialize OpenGL, expect problems

Post by flameout »

Hi
I upgraded my linux as you suggested and then used Nano and 'Screen' to run the admin program that I needed.
With Wine Dotnet installed OK but when running the program I got an error about mscoree.dll missing. I checked and it was missing. I then uploaded it from my Windows PC but that did not help. Perhaps being a DLL it needed to be registered before use???
Anyway it is all working now and mostly due to your help... thanks.
The admin program is usualy used as a Windows program and it uses C# to compile plugins. I was not aware that there was a console version of it, but for anyone else looking here is the link:
https://forum.myrcon.com/showthread.php ... Linux-mono
Locked