Thursday 22 February 2018

X11 tunnelling with audio

By default, X11 tunneling only support video but not audio. However, if both the server and the client is running Linux/Ubuntu, there is a way to do so. Hereby, I define 'server' as the machine running the actual program, 'client' as the machine which displays in front of the user.

The procedures are as follows:

1. Install and run paprefs, goto "Network server", check "Enable network access to local sound devices" and "Allow other machines on LAN to discover local sound devices"

2. on the client, run "start-pulseaudio-x11"

3. on the client, ssh to server with reverse SSH, "ssh -X -R 9998:localhost:4713 username@server"

4. in SSH, run the program on server, "PULSE_SERVER=localhost:9998 rhythmbox"

Monday 5 February 2018

Installing Office2010 using PlayOnLinux on Ubuntu 16.04 with Chinese input method

  A few years ago, I posted a quite troublesome method of installing Office2010 using Wine. Some issues are neglected. Nowadays, Ubuntu has evolved to have PlayOnLinux to get you through all those troubles.

All you need to do is the following:

0. Install winbind and samba using apt-get (if not installed)

1. Install PlayOnLinux, using the following command: 

    apt install playonlinux

2. Install Office2010 using PlayOnLinux and your MS-Office install CD

3. change configuration to support Chinese (or whatever non-latin language) input by editing those .desktop files, append "env XMODIFIERS='@im=fcitx' LC_ALL=zh_CN.UTF-8" at the beginning of the Exec command:

The original command line should look like following:
Exec=/usr/share/playonlinux/playonlinux --run "Microsoft Excel 2010" %F

You need to change it into the following:
Exec=env XMODIFIERS='@im=fcitx' LC_ALL=zh_CN.UTF-8 /usr/share/playonlinux/playonlinux --run "Microsoft Excel 2010" %F

Notes:
- if you are using some other using input method system (not fcitx), change the field '@im=fcitx' accordingly
- if you are using other non-latin languages (not Chinese), change the field LC_ALL=zh_CN.UTF-8 accordingly (see language code list at https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes)
- by default, PlayOnLinux will install those .desktop files to your desktop folder (at $HOME/Desktop) and your local shared application folder (at $HOME/.local/share/applications/playonlinux*.desktop). You can drag these icons onto your Unity launcher bar for convenient launching.

4. copy the 32-bit version of t2embed.dll and fontsub.dll (in C:\windows\system32 for 32-bit Windows, in C:\windows\SysWOW64\ for 64-bit Windows) from Windows into $WINE_PREFIX/drive_c/windows/system32 so that you can save Office document into PDF with embedded fonts. Otherwise, the resultant PDF file is very big due to bitmap fonts.

5. copy all fonts files from \Windows\Fonts into $WINE_PREFIX/drive_c/windows/Fonts so that you can now use all fonts that are available in Windows.

After doing all these steps, the resulting copy of MS-Office installation should support most of the functionalities, including non-English character display and input method, all Windows and Linux fonts, space efficient save-as-PDF, and can be launched via X11 tunneling (i.e., the PlayOnLinux MS-Office is installed on the server, run on server, but the GUI is displayed at the client).