13.9. 模拟 Windows:Wine
撇开之前提到的努力,还有大量工具在 Linux 中不存在替代品,或者必须使用原始版本。这时候就需要 Windows 模拟系统了。其中最出名的是 Wine。
补充 CrossOver Linux
CrossOver,有 CodeWeavers开发,是 Wine 的增强集合,承载了一系列的模拟特性来使 Microsoft Office 完全可以使用。某些增强会周期性的并入 Wine。
→ http://www.codeweavers.com/products/
然而,应当认识到这只是解决方案之一,问题也可以通过使用虚拟机或者 VNC来解决;两种解决方案在侧边栏有详细解释 其他选择 虚拟机 和 其他选择 Windows Terminal Server 或 VNC。
此处以提示开始:模拟允许在不同的宿主系统上执行程序(该程序在其他系统上开发)。模拟软件使用软件运行的宿主系统来模仿目标系统的需求特性。
Now let’s install the required packages (ttf-mscorefonts-installer is in the contrib section):
#
On a 64 bit (amd64) system, if your Windows applications are 32 bit applications, then you will have to enable multi-arch to be able to install wine32 from the i386 architecture (see 第 5.4.5 节 “多架构支持”).
The user then needs to run winecfg
and configure which (Debian) locations are mapped to which (Windows) drives. winecfg
has some sane defaults and can autodetect some more drives; note that even if you have a dual-boot system, you should not point the C:
drive at where the Windows partition is mounted in Debian, as Wine is likely to overwrite some of the data on that partition, making Windows unusable. Other settings can be kept to their default values. To run Windows programs, you will first need to install them by running their (Windows) installer under Wine, with a command such as wine *.../setup.exe*
; once the program is installed, you can run it with wine *.../program.exe*
. The exact location of the program.exe
file depends on where the C:
drive is mapped; in many cases, however, simply running wine *program*
will work, since the program is usually installed in a location where Wine will look for it by itself.
技巧winecfg 失败处理
In some cases, winecfg
(which is just a wrapper) might fail. As a work-around, it is possible to try to run the underlying command manually: wine64 /usr/lib/x86_64-linux-gnu/wine/wine/winecfg.exe.so
or wine32 /usr/lib/i386-linux-gnu/wine/wine/winecfg.exe.so
.
注意,如果没有实际进行测试,那么不能完全指望 Wine(或类似的方案):只有真正的使用测试才能决定模拟是否完全工作正常。
其他选择 虚拟机
另一种模拟微软操作系统的选择是在模拟的硬件虚拟机上运行该系统。这样可以运行任意的操作系统。第 12 章 高级管理 描述了几种虚拟系统,尤其值得关注的是 Xen 和 KVM(还有 QEMU,VMWare 和 Bochs)。
其他选择 Windows Terminal Server 或 VNC
另一种可能是在有Windows Terminal Server 的中央服务器上远程运行遗留的 Windows 应用程序,在 Linux 机器上使用rdesktop 来访问读取应用程序。这是一个 Linux 上的 RDP (Remote Desktop Protocol)协议客户端,Windows NT/2000 Terminal Server 使用该协议在远程机器上显示桌面。
VNC 软件提供类似的特性,它能在多种操作系统上工作。Linux VNC 客户端和服务器在 第 9.2 节 “远程登录”中有详细描述。