个人工具
登录
查看“UbuntuHelp:WineServer”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:WineServer”的源代码
来自Ubuntu中文
←
UbuntuHelp:WineServer
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/WineServer}} {{Languages|UbuntuHelp:WineServer}} Wine allows you to run many Windows programs on Linux. Its homepage can be found at http://www.winehq.org. If you are running the latest release of Wine, you can get further assistance on the #winehq IRC channel. == Introduction == The intention of the WineServer is to run Windows services or applications on boot without a user needing to login. The need for this arose when I wanted to run a Windows service called EdAlive Network Server on a Ubuntu school server. EdAlive Network Server normally runs on a Windows server and maintains each student's score and progress for their suite of educational software. == Installing Wine == Install the gnome desktop & winbind <pre><nowiki> sudo apt-get install ubuntu-desktop winbind </nowiki></pre> I use WineHQ's Ubuntu package from http://wine.budgetdedicated.com/archive/index.html Install the WineHQ package manually. <pre><nowiki> sudo dpkg -i ./wine_1.0* </nowiki></pre> After the Ubuntu-desktop, winbind and Wine are installed reboot the server. == Installing and Configuring the application == After a reboot, login as your non-root user. Open a terminal (Applications -> Accessories -> Terminal) and run winecfg to set the drives and other settings. <pre><nowiki> winecfg </nowiki></pre> Ample documentation on this utility is available on the WineHQ site. For now just click OK to close the utility. This will allow us to use a subdirectory of your home drive to install Windows programs in (~/.wine/drive_c/). Using the terminal change directory to where you have placed the Windows application and install the program using Wine. <pre><nowiki> cd /usr/local/src wine ./EdAliveServerInstaller.exe </nowiki></pre> Install the program as per usual, for this program I selected "Install as a normal program" as opposed to as a "Windows Service" (This was an option within the Windows installer). Installing as a service has worked for other programs (eg. NCH Software's TimeChimes) , but in this particular case it didn't work. Edit /etc/hosts so wine applications can work out the IP of the LAN interface. This seems to be a standard Wine trick... <code><nowiki>sudo vi /etc/hosts</nowiki></code> <pre><nowiki> 127.0.0.1 localhost 192.168.1.1 fileserver #127.0.1.1 fileserver.localdomain fileserver # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts </nowiki></pre> Check that the program works as intended. From the terminal: <pre><nowiki> cd ~/.wine/drive_c/Program Files/EdAlive Network Server wine ./EdAlive Network Server.exe </nowiki></pre> Or you can run it from the Applications menu under Wine. Assuming that the application works as intended we can now return our server to a text based headless server. == Starting Wine Applications on Boot == Create two new scripts in the /etc/init.d folder. The boot process will start the first script which in turn will execute the second script as the non-root user you installed the Wine application under. wine_launcher.sh <pre><nowiki> #!/bin/sh su - username -c /etc/init.d/wine.sh & </nowiki></pre> wine.sh <pre><nowiki> #!/bin/sh # Launches a new X session on display 3. X :3 -ac & # For nvidia graphics use #X :3 -ac & nvidia-settings --load-config-only # Forces the system to have a break for 2 seconds, X doesn't launch instantly sleep 2 # Launch the server. DISPLAY=:3 WINEDEBUG=-all wine "C:/Program Files/EdAlive Network Server/EdAlive Network Server.exe" & # Launch any other applications. # cd "/home/username/.wine/drive_c/Program Files/program_directory" #DISPLAY=:3 WINEDEBUG=-all wine "C:/Program Files/EdAlive Network Server/EdAlive Network Server.exe" & # To launch any applications installed as a service start any other wine application. eg notepad #DISPLAY=:3 WINEDEBUG=-all wine notepad & #Make sure you add the & to the end of the DISPLAY command to background the task so that the rest of the script continues to run. </nowiki></pre> Change the permissions to make the scripts executable. <pre><nowiki> chmod 755 /etc/init.d/wine.sh chmod 755 /etc/init.d/wine_launcher.sh </nowiki></pre> Add the link to wine_launcher.sh into /etc/rc.local to start the WineServer. <pre><nowiki> /etc/init.d/wine_launcher.sh </nowiki></pre> Edit /etc/X11/Xwrapper.config to allow anybody to start an X session. Change <code><nowiki>allowed_users=console </nowiki></code> To <code><nowiki>allowed_users=anybody</nowiki></code> If you don't want the Gnome Desktop Manager to start at boot, remove the symlinks from /etc/rc2.d et.al. Obviously is you want to keep the Gnome Desktop then omit this step - in that case you can switch back to the Gnome login by pressing <code><nowiki>ctrl+alt+F7</nowiki></code> after the server boots. <pre><nowiki> rm /etc/rc0.d/K01gdm rm /etc/rc2.d/S13gdm rm /etc/rc4.d/S13gdm rm /etc/rc5.d/S13gdm rm /etc/rc6.d/K01gdm </nowiki></pre> Reboot! After a reboot the server will switch to the X server window (ctrl+alt+F7 or ctrl+alt+F8 is gdm is running) which runs the Wine applications - to switch back to a console use ctrl+alt+F1 -> ctrl+alt+F6. === Related Wiki Pages === * [[UbuntuHelp:Wine|Wine]] * [[UbuntuHelp:WineForAMD64|WineForAMD64]] === Ubuntu Releases === 6.06LTS Server Dapper Drake - tested ---- [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:WineServer
。