LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 12-13-2002, 04:49 PM   #1
Omadon
LQ Newbie
 
Registered: Dec 2002
Posts: 1

Rep: Reputation: 0
Unhappy Wine + StarCraft + X Cannot connect to server :1


I've seen this posted on another message board but there was no response.. I'm having the same problem so I thought I'd ask here.
I'm running RedHat 8.0 and Gnome.
Thanks for any help!!!



-- BEGIN QUOTE --

I'm using this script to try and run starcraft on a different desktop. The script contains this:

code: #!/bin/bash
# Author: Brian King
# Comments partially edited by Ilkka Forsblom
# TODO: Check if the cdrom in the drive is the starcraft cdrom.
#
TYPE=$1
NORMINST="/c/Program Files/Starcraft/Starcraft.exe"
# If you have a separate spawn installation, running this script
# with the argument "spawn" will run the spawn installation
# (defined here) instead.
SPAWNINST="/home/dos/Program Files/starcraft/StarCraft.exe"
# This should be your cdrom device ... it should also be in your
# wine.conf somewhere...
DEVICE="/dev/hda"
# This file should be an XF86Config file with only the 640x480x8bit
# entry available. The file should be in the same directory as the
# default XF86Config file.
CONFIG="XF86.star"
# uncomment for esound support
#SOUND="/usr/bin/esddsp "

ISLINK=`/bin/ls -l $DEVICE|grep "\->"`
if [ "x${ISLINK}" != "x" ] ; then DEVICE=`/bin/ls -l $DEVICE|sed -e 's/.*-> //'`
fi

DFOUT=`df|grep $DEVICE`

# I believe this should flush all buffers to disk and minimize damage
# if starcraft fails. I added this because I just lost my last 5 days of
# work from a starcraft crash.
sync;sync;sync

# if the cdrom isn't mounted and we're not playing a spawn game
if [ "x${DFOUT}" = "x" ] && [ "x${TYPE}" != "xspawn" ] ; then
# mount cdrom
eject
echo "enter cdrom then hit enter"
read enter
mount $DEVICE
fi
echo $TYPE
if [ "x${TYPE}" = "xspawn" ] ; then/usr/X11R6/bin/xinit $SOUND /usr/local/bin/wine --display :1 "$SPAWNINST" -- :1
-xf86config $CONFIG
else
/usr/X11R6/bin/xinit /usr/local/bin/wine --display :1 "$NORMINST" -- :1 -xf86con
fig $CONFIG
fi



The parts about SPAWNINST can be ignored. Anyway, when I try to run this script as a user, the other server starts up, but nothing else happens, and it says:

AUDIT: Tue Sep 25 17:34:22 2001: 1333 X: client 1 rejected from local host
Xlib: connection to ":1.0" refused by server
Xlib: Client is not authorized to connect to Server

If I try to run it as root it says:

/usr/X11R6/bin/xinit: No such file or directory (errno 2): no server "X" in PATH

Use the -- option, or make sure that /usr/X11R6/bin is in your path and
that "X" is a program or a link to the right type of server
for your display. Possible server names include:

XFree86 XFree86 displays

Anyone know what could be causing this ailment?


-- END QUOTE --
 
Old 12-13-2002, 10:22 PM   #2
jdc2048
Member
 
Registered: Jul 2002
Distribution: Redhat, Gentoo, Solaris, HP-UX, etc...
Posts: 391

Rep: Reputation: 30
I have not tried this before, but usually when you get a "Client is not authorized to connect to Server", then you do a "xhost +<hostname>" to allow this. You can also try the "xhost +" by itself to allow anyone to connect to the X server.

Sorry if this doesn't get it.
 
Old 12-14-2002, 05:35 PM   #3
ubien
Member
 
Registered: Oct 2002
Distribution: RH 8.0 and fluxbox
Posts: 122

Rep: Reputation: 15
I'm gunna go with a quick cop out, have you tried it using WineX? WineX is usually better with all games. RPM may cost money, but CVS version of WineX is free.
 
Old 11-26-2003, 05:51 PM   #4
futhark
Member
 
Registered: Nov 2003
Location: Montréal (Can)
Distribution: FC4
Posts: 110

Rep: Reputation: 15
Question

I've got the same problem. Note this script opens display :1 for running starcraft into it. "xhost +" will affect display :0 but not :1.

My question to you all is : how can we disable access control on an arbitrary display?

Thanks!
 
Old 11-26-2003, 06:40 PM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Moved: More suitable in our Games forum.
 
Old 01-03-2004, 03:55 PM   #6
futhark
Member
 
Registered: Nov 2003
Location: Montréal (Can)
Distribution: FC4
Posts: 110

Rep: Reputation: 15
Talking

Hello all,

I have found how to start display :1 with a regular user account to run a game into it. I have also an example script for running a game conviently. I have tested this on RedHat9.0 and it works nicely.

The following has been of great help to me:
http://bau2.uibk.ac.at/matic/xsecur.htm
mcookie manpage

This small howto is divided in 3 parts:
1- How to connect on X display 1
2- How to set set display 1 resolution and depth
3- How to automate game startup on display 1 with a script

Howto version : 2004-01-03

=== PART 1
=== How to connect on X display 1

The problem is typically the following. When opening a new display, it rejects connections with messages like the following:

Code:
$ xinit -- :1
AUDIT: Sat Jan  3 12:24:38 2004: 23447 X: client 1 rejected from local host
Xlib: connection to ":1.0" refused by server
Xlib: No protocol specified
his is because no authentication cookie has been created for the display. A cookie is a secret number used by the display to know who is authorized using it. The display only allows users knowing the secret number. Obviously, no one will ever be able to connect on display if no cookie is associated with it. A display without a cookie is a display on which it is impossible to connect. This is a basic security rule : to be hermetic by default.

The command below shows cookies exist for the display :0 only by default.

Code:
$ xauth list
phil/unix:0  MIT-MAGIC-COOKIE-1  b1b144b1ee50cd5dff484198ae19f99d
phil:0  MIT-MAGIC-COOKIE-1  b1b144b1ee50cd5dff484198ae19f99d
The solution is to create a cookie for the display prior to using it. It is as simple as that:

Code:
$ xauth add  :1 . `mcookie`
The syntax is self explanatory except for the dot (.). The dot represents the authentication protocol we will be using. In RedHat9, this protocol is MIT-MAGIC-COOOKIE-1. Quoting the manpage: "A protocol name consisting of just a single period is treated as an abbreviation for MIT-MAGIC-COOKIE-1".

Then, opening the display will work right away:

Code:
$ xinit -- :1
By default, a cookie is automatically generated for the display :0 only. This explains why it is not possible to connect on new displays. It is OK to run "xauth add :1 . `mcookie`" everytime you want to use the display :1. You can also have the cookie created automatically for you everytime you open a graphical session on your system. All you have to do is to modify /usr/X11R6/bin/startx slightly. Look around line 130 for the following block of code.

Code:
[snip]
authdisplay=${display:-:0}
mcookie=`mcookie`
for displayname in $authdisplay $hostname$authdisplay; do
    if ! xauth list "$displayname" | grep "$displayname " >/dev/null 2>&1; then
        xauth << EOF 
add $displayname . $mcookie
EOF
	removelist="$displayname $removelist"
    fi
done
[snip]
Edit the first line so it looks exactly like this:

Code:
authdisplay=${display:-:0 :1}
It will have the script create cookies for displays 0 and 1 the next time a graphical session is started. Logout/login and verify the change has taken effect:

Code:
$ xauth list
phil/unix:0  MIT-MAGIC-COOKIE-1  9d6b030498cbd20b6e3de6e198bcc52a
phil/unix:1  MIT-MAGIC-COOKIE-1  9d6b030498cbd20b6e3de6e198bcc52a
phil:0  MIT-MAGIC-COOKIE-1  9d6b030498cbd20b6e3de6e198bcc52a
Note our change to startx is quick and dirty. Our display 1 cookie wouldn't get created if the $display variable was set. I didn't find the case where this variable gets set.

=== PART 2
=== How to set set display 1 resolution and depth

I also found a neat way of starting display :1 with a specific bit depth and resolution.

As a first step, edit your /etc/X11/XF86Config file and add common resolutions you use for your games. Make sure each screen definition is given a unique Identifier string. For example:

Code:
Section "Screen"
  Identifier "640x480"
	Device     "Videocard0"
	Monitor    "Monitor0"
	DefaultDepth     24
	SubSection "Display"
		Depth     8
		Modes    "640x480"
	EndSubSection
	SubSection "Display"
		Depth     16
		Modes    "640x480"
	EndSubSection
	SubSection "Display"
		Depth     24
		Modes    "640x480"
	EndSubSection
EndSection

Section "Screen"
  Identifier "800x600"
	Device     "Videocard0"
	Monitor    "Monitor0"
	DefaultDepth     24
	SubSection "Display"
		Depth     8
		Modes    "800x600"
	EndSubSection
	SubSection "Display"
		Depth     16
		Modes    "800x600"
	EndSubSection
	SubSection "Display"
		Depth     24
		Modes    "800x600"
	EndSubSection
EndSection
When I play Starcraft, I open my display like this:

Code:
$ xinit -- :1 -screen 640x480 -depth 16
(Note Starcraft does not display anything when I use a 8bpp display)

Then, when I play Warcraft 3:

Code:
$ xinit -- :1 -screen 800x600 -depth 24
And so on!

=== PART 3
=== How to automate game startup on display 1 with a script

Finally, you can create a short script to start a game conveniently. I have saved the following script in /usr/local/bin and added this directory in my PATH. When I want to play Warcraft3, all I do is:

Code:
$ war3.sh
Copy this script and adapt it for every game you're playing.

Code:
[snip]
#!/bin/sh

GAME_PATH="/opt/winedir/c_drive/war3"
GAME_EXE="war3.exe -opengl"

SCREEN_RES="800x600" # Must match screen identifier in XF86Config
SCREEN_BPP="24"      # Must be defined for screen in XF86Config

WINE_CMD="cd $GAME_PATH ; wine -- $GAME_EXE"
xinit /bin/sh -c "$WINE_CMD" -- :1 -screen $SCREEN_RES -depth $SCREEN_BPP
[snip]
Change GAME_PATH, GAME_EXE, SCREEN_RES and SCREEN_BPP according to your needs. When changing SCREEN_RES and SCREEN_BPP, make sure the corresponding res and depth and defined in your /etc/X11/XF86Config file.


Happy gaming!

Last edited by futhark; 01-03-2004 at 04:38 PM.
 
Old 08-23-2006, 10:10 AM   #7
heri0n
Member
 
Registered: Oct 2004
Location: Hamilton, Ontario
Distribution: Slackware 10.0
Posts: 48

Rep: Reputation: 15
Even if I add a magic cookie I get the error...

X: user not authorized to run the X server, aborting.
xinit: Server error.

Even if I sudo xinit
What should i do
 
Old 09-02-2006, 09:30 AM   #8
futhark
Member
 
Registered: Nov 2003
Location: Montréal (Can)
Distribution: FC4
Posts: 110

Rep: Reputation: 15
I have improved this procedure and posted another verseion here if you're interested:
http://groups.google.com/group/comp....b8df65916efd78

If you want to know if your display is accessible, the trick is to try running an app inside:
xinit /usr/X11R6/bin/glxgears -- :1

If that does not work, then really make sure xauth list shows a cookie for all displays you want to use:
phil/unix:0 MIT-MAGIC-COOKIE-1 12db9a923d4357867c5861790b92a4a9
phil/unix:1 MIT-MAGIC-COOKIE-1 ef459a2edce62fb95bd8c1106d8e11e8

Default X security settings may vary from one distro to another. I have been using this trick for a long time on Fedora (I'm currently on 4).
 
Old 03-08-2007, 07:00 PM   #9
StarCraft-Master
LQ Newbie
 
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
I am going to try out SCL (StarCraftLinux). I will tell everybody how it goes.
 
Old 03-08-2007, 07:01 PM   #10
StarCraft-Master
LQ Newbie
 
Registered: Mar 2007
Posts: 6

Rep: Reputation: 0
I recently came across SCL Beta (StarCraftLinux)
http://wiw.xlphp.net/sclhome.htm

I downloaded it and it was able to install starcraft and broodwar seamlessly. It ran perfectly as if it were running on windows. It allowed me to run starcraft without a disk, in a separate x session, and play multi player (battle.net and Local Area Network.) games

It is still in the early developmental stages and might not work entirely. It worked perfectly for me, so go give it a try.

Future versions will auto detect hardware, will have support for StarCraft2 (will automatically download and install it) and much more. These are just a fraction of the future features (all that I can remember).

Download SCL, run it, PLAY SOME STARCRAFT!!!!!!!

also,

I am running knoppix 5.1 with wine 0.9.12
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wine and starcraft Zero-0-Effect Linux - Games 3 02-25-2011 04:50 AM
must.. have.. starcraft (which wine to use?) End11 Linux - Games 17 03-09-2007 08:40 AM
starcraft with wine zexter Linux - Software 15 03-08-2007 07:05 PM
Starcraft in WINE Nebetsu Linux - Games 6 03-08-2007 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration