Skip to content

Instantly share code, notes, and snippets.

@dwongdev
Forked from eylenburg/msoffice_in_linux.md
Created February 15, 2025 07:43
Show Gist options
  • Save dwongdev/d430eb96589e26099f291d0f703dec93 to your computer and use it in GitHub Desktop.
Save dwongdev/d430eb96589e26099f291d0f703dec93 to your computer and use it in GitHub Desktop.

Revisions

  1. @eylenburg eylenburg revised this gist Nov 25, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -50,9 +50,9 @@ _Winapps requires either Docker or Podman to run the Windows VM and can also wor

    Most distributions will have `podman` and `podman-compose` in their repositories, so just install those.

    You will also need `freerdp` some more packages (`dialog`, `iproute`, `libnotify`, `netcat`) to run Winapps: [For the names of the required packages see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-install-dependencies)
    You will also need `freerdp` and some more packages (`dialog`, `iproute`, `libnotify`, `netcat`) to run Winapps: [For the names of the required packages see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-install-dependencies)

    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled, you just need to install `podman-compose` and the other required packages with this command: `rpm-ostree install podman-compose freerdp dialog iproute libnotify nmap-ncat`, then reboot.
    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled, you can run this command: `rpm-ostree install podman-compose freerdp dialog iproute libnotify nmap-ncat`, then reboot.

    ## Step 2: Download Winapps

  2. @eylenburg eylenburg revised this gist Nov 25, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -46,7 +46,7 @@ The Wine-based options limit you to Office 2016 or older and only the core apps

    ## Step 1: install required packages

    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. If you already have a Windows VM set up, please refer to the Winapps documentation. I'll be using Podman to set up a new Windows VM in the below instructions. _
    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. If you already have a Windows VM set up, please refer to the Winapps documentation. I'll be using Podman to set up a new Windows VM in the below instructions._

    Most distributions will have `podman` and `podman-compose` in their repositories, so just install those.

  3. @eylenburg eylenburg revised this gist Nov 25, 2024. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -54,8 +54,6 @@ You will also need `freerdp` some more packages (`dialog`, `iproute`, `libnotify

    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled, you just need to install `podman-compose` and the other required packages with this command: `rpm-ostree install podman-compose freerdp dialog iproute libnotify nmap-ncat`, then reboot.

    In OpenSUSE Tumbleweed (not yet mentioned in Winapps readme): `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd iproute2 libnotify`

    ## Step 2: Download Winapps

    Create a new folder ~/bin/winapps and then run `git clone https://github.com/winapps-org/winapps.git && cd winapps` to download the newest version of Winapps.
  4. @eylenburg eylenburg revised this gist Nov 25, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ The Wine-based options limit you to Office 2016 or older and only the core apps

    # Option 1: Running any Office version (including 365) with Winapps

    **For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for me in July 2024. **
    **For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for me in July 2024.**

    ## Step 1: install required packages

  5. @eylenburg eylenburg revised this gist Nov 25, 2024. 1 changed file with 7 additions and 8 deletions.
    15 changes: 7 additions & 8 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -42,19 +42,19 @@ The Wine-based options limit you to Office 2016 or older and only the core apps

    # Option 1: Running any Office version (including 365) with Winapps

    For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for me in July 2024.
    **For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for me in July 2024. **

    ## Step 1: install required packages

    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. I'll be using Podman in the below instructions._
    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. If you already have a Windows VM set up, please refer to the Winapps documentation. I'll be using Podman to set up a new Windows VM in the below instructions. _

    _For the Winapps app itself, you need `freerdp` to connect to the VM and `dialog` to run the Winapps installer. On my Fedora Kinoite I also needed to install `netcat`. If you are using Podman (or Docker) to run the VM you also need `podman` and `podman-compose` (or the same for Docker)._
    Most distributions will have `podman` and `podman-compose` in their repositories, so just install those.

    [For required dependencies see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-clone-winapps-repository-and-dependencies)
    You will also need `freerdp` some more packages (`dialog`, `iproute`, `libnotify`, `netcat`) to run Winapps: [For the names of the required packages see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-install-dependencies)

    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled: `rpm-ostree install podman-compose freerdp dialog iproute libnotify nmap-ncat`, then reboot.
    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled, you just need to install `podman-compose` and the other required packages with this command: `rpm-ostree install podman-compose freerdp dialog iproute libnotify nmap-ncat`, then reboot.

    In OpenSUSE Tumbleweed: `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd iproute2 libnotify`
    In OpenSUSE Tumbleweed (not yet mentioned in Winapps readme): `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd iproute2 libnotify`

    ## Step 2: Download Winapps

    @@ -92,10 +92,9 @@ Create a brand new file called `~/.config/winapps/winapps.conf` (same folder whe
    RDP_USER="MyWindowsUser"
    RDP_PASS="MyWindowsPassword"
    WAFLAVOR="podman"
    RDP_SCALE=140
    ```

    The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and use scaling on the Linux host already. The example above means 140% scaling.
    Please refer to [this documentation](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-3-create-a-winapps-configuration-file) for all the other options, e.g. you might want to add `RDP_SCALE` for HiDPI monitors or `AUTOPAUSE` to pause the Windows VM when no app is running.

    ## Step 7: Test Winapps

  6. @eylenburg eylenburg revised this gist Nov 25, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -52,9 +52,9 @@ _For the Winapps app itself, you need `freerdp` to connect to the VM and `dialog

    [For required dependencies see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-clone-winapps-repository-and-dependencies)

    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled: `rpm-ostree install podman-compose freerdp dialog netcat`, then reboot.
    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled: `rpm-ostree install podman-compose freerdp dialog iproute libnotify nmap-ncat`, then reboot.

    In OpenSUSE Tumbleweed: `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd`
    In OpenSUSE Tumbleweed: `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd iproute2 libnotify`

    ## Step 2: Download Winapps

  7. @eylenburg eylenburg revised this gist Sep 23, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ The Wine-based options limit you to Office 2016 or older and only the core apps

    | |Winapps|Crossover|PlayOnLinux 4|
    |:----|:----|:----|:----|
    |Compatible with|Office 365, 2021, 2019, 2016, 2013, 2010, 2007.<br />All Office components|Office 365, 2016, 2010, 2007.<br />Excel/Word/Powerpoint|Office 2016, 2013, 2010, 2007.<br />Excel/Word/Powerpoint|
    |Compatible with|Office 365, 2024, 2021, 2019, 2016, 2013, 2010, 2007.<br />All Office components|Office 365, 2016, 2010, 2007.<br />Excel/Word/Powerpoint|Office 2016, 2013, 2010, 2007.<br />Excel/Word/Powerpoint|
    |Compatibility rating|⭐⭐⭐⭐⭐|[⭐⭐⭐⭐](https://www.codeweavers.com/compatibility/crossover/microsoft-office-2016)|[⭐⭐⭐](https://appdb.winehq.org/objectManager.php?iId=34941&sClass=version)|
    |What doesn't work|Window management can be janky (e.g. using multiple open Office windows).|Some components like Onedrive, Outlook and Onenote don't work or with limited features. Might crash from time to time, so always remember to save your work. Some UI bugs or janky window management.|Some components like Onedrive, Outlook and Onenote don't work or with limited features. Relatively frequent crashes, so always remember to save your work. Some UI bugs or janky window management.|
    |Cost|Free <br />+ can pirate Office|$60/€60/£60 for Crossover <br />+ genuine Office license needed|Free <br />+ genuine Office license needed|
    @@ -42,7 +42,7 @@ The Wine-based options limit you to Office 2016 or older and only the core apps

    # Option 1: Running any Office version (including 365) with Winapps

    For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for my in July 2024.
    For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for me in July 2024.

    ## Step 1: install required packages

  8. @eylenburg eylenburg revised this gist Sep 20, 2024. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -92,14 +92,14 @@ Create a brand new file called `~/.config/winapps/winapps.conf` (same folder whe
    RDP_USER="MyWindowsUser"
    RDP_PASS="MyWindowsPassword"
    WAFLAVOR="podman"
    RDP_SCALE=150
    RDP_SCALE=140
    ```

    The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and use scaling on the Linux host already. The example above means 150% scaling.
    The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and use scaling on the Linux host already. The example above means 140% scaling.

    ## Step 7: Test Winapps

    In the Winapps folder, run `./installer.sh` which will guide you. In the installer, add Explorer.exe (hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux). It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.
    In the Winapps folder, run `./setup.sh` which will guide you. In the installer, add Explorer.exe (hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux). It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.

    ## Step 8: Localisation (optional)

    @@ -124,11 +124,11 @@ This is automatically set up by Winapps, but I would recommend that in the VM, y

    This is needed because we previously (in Step 7) just added Explorer.exe and now we want to add the Office apps too.

    1. Open a terminal in your Winapps folder and run `./installer.sh` again and this time select Uninstall.
    1. Open a terminal in your Winapps folder and run `./setup.sh` again and this time select Uninstall.

    ## Step 12: Add Office apps to Linux

    Run `./installer.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint. (Hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux)
    Run `./setup.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint. (Hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux)

    ## Troubleshooting: Prevent Windows auto-login

  9. @eylenburg eylenburg revised this gist Aug 1, 2024. 1 changed file with 6 additions and 8 deletions.
    14 changes: 6 additions & 8 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -103,7 +103,7 @@ In the Winapps folder, run `./installer.sh` which will guide you. In the install

    ## Step 8: Localisation (optional)

    The default VM is set to English US, US keyboard, US timezone etc. To change that, enter the VM (`127.0.0.1:8006` in browser, default password is `MyWindowsPassword`):
    The default VM is set to English US, US keyboard, US timezone etc. To change that, enter the VM through the newly created starter "Windows" in your Linux start menu, and then:

    1. Go to Windows settings and set the correct regional format, display language and keyboard layout.

    @@ -114,19 +114,17 @@ The default VM is set to English US, US keyboard, US timezone etc. To change tha

    ## Step 9: Install Microsoft Office or other required applications

    Access the VM through the browser. Then install, for example, Microsoft Office 365 and activate it. **Pirating works** unlike when using Crossover or PlayonLinux.
    Access the VM through the "Windows" starter. Then install, for example, Microsoft Office 365 and activate it. **Pirating works** unlike when using Crossover or PlayonLinux.

    ## Step 10: Tidy up Quick Access

    This is automatically set up by Winapps, but I would recommend that in the VM, you add the Linux drive (found in "This PC") to the File Explorer's "Quick Access" and remove the other (useless) folders like Documents and Picutres from the Quick Access.
    This is automatically set up by Winapps, but I would recommend that in the VM, you add the Linux drive (found in "This PC") to the File Explorer's "Quick Access" and remove the other (useless) folders like Documents and Pictures from the Quick Access.

    ## Step 11: Uninstall Winapps (temporarily)

    This is needed because we previously (in Step 7) just added Explorer.exe and now we want to add the Office apps too.

    1. In the VM, sign out the user (Start Menu -> click on the username -> Sign Out).

    2. Then back in Linux, run `./installer.sh` again and this time select Uninstall.
    1. Open a terminal in your Winapps folder and run `./installer.sh` again and this time select Uninstall.

    ## Step 12: Add Office apps to Linux

    @@ -136,9 +134,9 @@ Run `./installer.sh` another time and this time select "Install" and select all

    _For me, the VM was defaulting to auto-login. However, for Winapps to connect to the VM, the user must be logged out. Otherwise you will just get a black full-screen windows when you attempt to start a Windows app from Linux._

    In the VM (127.0.0.1:8006 in browser), right-click on the start menu, then on "Run", then enter `netplwiz` and check the `[x] Users must enter a user name and password to use this computer` option.
    Open the VM (`127.0.0.1:8006` in browser if you can't connect through the "Windows" shortcut), then right-click on the start menu, then on "Run", then enter `netplwiz` and check the `[x] Users must enter a user name and password to use this computer` option.

    Then sign out again (Start Menu -> click on the username -> Sign Out).
    Then sign out (Start Menu -> click on the username -> Sign Out).

    ## Troubleshooting: auto-starting the VM

  10. @eylenburg eylenburg revised this gist Jul 30, 2024. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,19 @@ The VM-based options means can run Office 2021 or Office 365 including all apps,

    The Wine-based options limit you to Office 2016 or older and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay and quite similar to the newest Office versions, although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).

    | |Winapps|Crossover|PlayOnLinux 4|
    |:----|:----|:----|:----|
    |Compatible with|Office 365, 2021, 2019, 2016, 2013, 2010, 2007.<br />All Office components|Office 365, 2016, 2010, 2007.<br />Excel/Word/Powerpoint|Office 2016, 2013, 2010, 2007.<br />Excel/Word/Powerpoint|
    |Compatibility rating|⭐⭐⭐⭐⭐|[⭐⭐⭐⭐](https://www.codeweavers.com/compatibility/crossover/microsoft-office-2016)|[⭐⭐⭐](https://appdb.winehq.org/objectManager.php?iId=34941&sClass=version)|
    |What doesn't work|Window management can be janky (e.g. using multiple open Office windows).|Some components like Onedrive, Outlook and Onenote don't work or with limited features. Might crash from time to time, so always remember to save your work. Some UI bugs or janky window management.|Some components like Onedrive, Outlook and Onenote don't work or with limited features. Relatively frequent crashes, so always remember to save your work. Some UI bugs or janky window management.|
    |Cost|Free <br />+ can pirate Office|$60/€60/£60 for Crossover <br />+ genuine Office license needed|Free <br />+ genuine Office license needed|
    |RAM use|Significant (need to run a Windows VM in the background)|Normal|Normal|
    |Integration into Linux (e.g. file associations)|Good|Good|Good|
    |Ease of set-up|Complicated|Easy|Easy if the [install script](https://www.playonlinux.com/en/app-4203-Microsoft_Office_2016_method_B.html) happens to work, otherwise complicated.|
    |Compatible with immutable Linux distros|Need to layer some extra packages from repo|Need to install in Distrobox|Need to install in Distrobox*|

    *There's a Flatpak of PlayOnLinux 4 now but I couldn't get it to run Microsoft Office.

    # Table of Contents

    **[Option 1: Running any Office version (including 365) with Winapps](#option-1-running-any-office-version-including-365-with-winapps)**
    @@ -281,6 +294,8 @@ Now you can close the Crossover window.

    This guide is largely based on [this one from Jaydin](https://askubuntu.com/questions/975104/how-do-i-install-ms-office-2016-on-playonlinux) which comes with some helpful screenshots.

    PlayOnLinux contains an [install script](https://www.playonlinux.com/en/app-4203-Microsoft_Office_2016_method_B.html) for Office 2016 and older. If it works for you, then it's all good, but for me it failed and I had to install it manually:

    ### Step 0: Get Office

    Log in to your Microsoft account, download the MS Office "offline" image (multiple GB, ending in .img) and note down your product key (this can also be found in your Microsoft account at the same place where you download the .img file)
  11. @eylenburg eylenburg revised this gist Jul 28, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -169,7 +169,7 @@ _"Backup files" in this case actually refers to all files with the `application/
    find ~ -type f \( -name '~$*.xlsx' -o -name '~$*.docx' -o -name '~$*.pptx' \) 2>/dev/null -exec rm {} \;
    ```

    _This command will find all files matching the specified patterns (~$*.xlsx, ~$*.docx, and ~$*.pptx) in the home folder (~) and remove them with the `rm` command. `2>/dev/null` is used to suppress any “permission denied” messages for folders you don't have access to._
    _This command will find all files matching the specified patterns (`~$*.xlsx`, `~$*.docx`, and `~$*.pptx`) in the home folder (`~`) and remove them with the `rm` command. `2>/dev/null` is used to suppress any “permission denied” messages for folders you don't have access to._


    2. You can save this bash script, e.g. as `~/bin/office_cleanup.sh`.
  12. @eylenburg eylenburg revised this gist Jul 28, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -33,9 +33,9 @@ For steps 1-6 you should [check the official documentation](https://github.com/w

    ## Step 1: install required packages

    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. I'll be using Podman in the below instructions.
    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. I'll be using Podman in the below instructions._

    For the Winapps app itself, you need `freerdp` to connect to the VM and `dialog` to run the Winapps installer. On my Fedora Kinoite I also needed to install `netcat`. If you are using Podman (or Docker) to run the VM you also need `podman` and `podman-compose` (or the same for Docker)._
    _For the Winapps app itself, you need `freerdp` to connect to the VM and `dialog` to run the Winapps installer. On my Fedora Kinoite I also needed to install `netcat`. If you are using Podman (or Docker) to run the VM you also need `podman` and `podman-compose` (or the same for Docker)._

    [For required dependencies see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-clone-winapps-repository-and-dependencies)

  13. @eylenburg eylenburg revised this gist Jul 28, 2024. 1 changed file with 166 additions and 163 deletions.
    329 changes: 166 additions & 163 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -3,28 +3,183 @@
    There are multiple options how to install MS Office on Linux.


    **VM-based** - Integrate Windows apps running in a Windows VM as native-looking in Linux
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits). **[Decribed below](#option-3-running-any-office-version-including-365-with-winapps)**
    **VM-based** - Integrate Windows apps running in a Windows virtual machine as native-looking in Linux
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits). **[Decribed below](#option-1-running-any-office-version-including-365-with-winapps)**
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, libvirt/virt-manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

    The VM-based options means can run Office 2021 or Office 365 including all apps, but while the Windows apps themselves run flawlessly (as they're running on real Windows) there's various freerdp-related bugs you may encounter.

    **Wine-based**

    1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies, but [this guy managed to](https://elsotanoenlared.es/office-2016-32-bits-en-linux-con-bottles/)
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script but it is possible with some tinkering (see below). Newer versions of Office are not supported. **[Described below](#option-2-using-office-2016-in-playonlinux)**
    3. Crossover (paid) -> apparently supports Office 2016 and older. It's the easiest way to get a semi-modern office working in Linux without much tinkering. **[Described below](#option-1-using-office-2016-in-crossover-paid)**
    1. Crossover (paid) -> supports Office 2016 and older (and apparently even 365 but not sure how stable). It's the easiest way to get a semi-modern office working in Linux without much tinkering. **[Described below](#option-2-using-office-2016-in-crossover-paid)**
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script but it is possible with some tinkering (see below). Newer versions of Office are not supported. **[Described below](#option-3-using-office-2016-in-playonlinux)**
    3. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies, but [this guy managed to](https://elsotanoenlared.es/office-2016-32-bits-en-linux-con-bottles/)

    The Wine-based options limit you to Office 2016 or older and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay and quite similar to the newest Office versions, although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).

    **[Option 1: Using Office 2016 in Crossover (paid)](#option-1-using-office-2016-in-crossover-paid)**
    # Table of Contents

    **[Option 2: Using Office 2016 in PlayOnLinux](#option-2-using-office-2016-in-playonlinux)**
    **[Option 1: Running any Office version (including 365) with Winapps](#option-1-running-any-office-version-including-365-with-winapps)**

    **[Option 3: Running any Office version (including 365) with Winapps](#option-3-running-any-office-version-including-365-with-winapps)**
    **[Option 2: Using Office 2016 in Crossover (paid)](#option-2-using-office-2016-in-crossover-paid)**

    **[Option 3: Using Office 2016 in PlayOnLinux](#option-3-using-office-2016-in-playonlinux)**

    # Option 1: Using Office 2016 in Crossover (paid)


    # Option 1: Running any Office version (including 365) with Winapps

    For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for my in July 2024.

    ## Step 1: install required packages

    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. I'll be using Podman in the below instructions.

    For the Winapps app itself, you need `freerdp` to connect to the VM and `dialog` to run the Winapps installer. On my Fedora Kinoite I also needed to install `netcat`. If you are using Podman (or Docker) to run the VM you also need `podman` and `podman-compose` (or the same for Docker)._

    [For required dependencies see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-clone-winapps-repository-and-dependencies)

    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled: `rpm-ostree install podman-compose freerdp dialog netcat`, then reboot.

    In OpenSUSE Tumbleweed: `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd`

    ## Step 2: Download Winapps

    Create a new folder ~/bin/winapps and then run `git clone https://github.com/winapps-org/winapps.git && cd winapps` to download the newest version of Winapps.

    ## Step 3: Spin up the VM

    _The Winapps folder contains a file called compose.yaml which defines your Windows VM. Please refer to the Winapps documentation for details, but we can just keep the default settings which will install "Tiny11" (a minimal version of Windows 11)._

    In the Winapps folder, run this command: `podman-compose --file ./compose.yaml up`

    Then open 127.0.0.1:8006 in the browser to access the Windows VM and check that the installation was successful.

    ## Step 4: Create compose.yaml for Winapps

    Open the compose.yaml and make these two changes below:

    1. For autostart after a reboot, edit the "restart" line: `restart: always`

    2. Then comment out the "oem" line: `#- ./oem:/oem`

    3. Save your edited file here: `~/.config/winapps/compose.yaml`

    ## Step 5: Apply the new configuration

    Still in the Winapps folder, run `podman-compose --file ./compose.yaml down && podman-compose --file ~/.config/winapps/compose.yaml up`

    Again, check that your VM is running in 127.0.0.1:8006. If the user is logged in (i.e. you can see the desktop) then make sure to log out (Start Menu -> click on the username -> Sign Out).

    ## Step 6: Create your Winapps config file

    Create a brand new file called `~/.config/winapps/winapps.conf` (same folder where you saved the compose.yaml), and insert this:

    ```
    RDP_USER="MyWindowsUser"
    RDP_PASS="MyWindowsPassword"
    WAFLAVOR="podman"
    RDP_SCALE=150
    ```

    The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and use scaling on the Linux host already. The example above means 150% scaling.

    ## Step 7: Test Winapps

    In the Winapps folder, run `./installer.sh` which will guide you. In the installer, add Explorer.exe (hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux). It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.

    ## Step 8: Localisation (optional)

    The default VM is set to English US, US keyboard, US timezone etc. To change that, enter the VM (`127.0.0.1:8006` in browser, default password is `MyWindowsPassword`):

    1. Go to Windows settings and set the correct regional format, display language and keyboard layout.

    2. Start the Registry Editor (right-click on start menu, "Run", `regedit`)
    * go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]` and add a new DWORD `IgnoreRemoteKeyboardLayout` with value 1
    * go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]` and add new DWORD `RealTimeIsUniversal` with value 1
    * then reboot the Windows VM

    ## Step 9: Install Microsoft Office or other required applications

    Access the VM through the browser. Then install, for example, Microsoft Office 365 and activate it. **Pirating works** unlike when using Crossover or PlayonLinux.

    ## Step 10: Tidy up Quick Access

    This is automatically set up by Winapps, but I would recommend that in the VM, you add the Linux drive (found in "This PC") to the File Explorer's "Quick Access" and remove the other (useless) folders like Documents and Picutres from the Quick Access.

    ## Step 11: Uninstall Winapps (temporarily)

    This is needed because we previously (in Step 7) just added Explorer.exe and now we want to add the Office apps too.

    1. In the VM, sign out the user (Start Menu -> click on the username -> Sign Out).

    2. Then back in Linux, run `./installer.sh` again and this time select Uninstall.

    ## Step 12: Add Office apps to Linux

    Run `./installer.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint. (Hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux)

    ## Troubleshooting: Prevent Windows auto-login

    _For me, the VM was defaulting to auto-login. However, for Winapps to connect to the VM, the user must be logged out. Otherwise you will just get a black full-screen windows when you attempt to start a Windows app from Linux._

    In the VM (127.0.0.1:8006 in browser), right-click on the start menu, then on "Run", then enter `netplwiz` and check the `[x] Users must enter a user name and password to use this computer` option.

    Then sign out again (Start Menu -> click on the username -> Sign Out).

    ## Troubleshooting: auto-starting the VM

    For me, the Podman container containing the Windows VM didn't auto-start after a computer reboot, even though I set `restart: always` in the the compose.yaml. A workaround would be to create this small bash script and add it to the autostart:

    1. Create the bash script:

    ```
    #!/bin/bash
    sleep 20 && podman-compose --file ~/.config/winapps/compose.yaml start
    ```

    _(I'm not sure why but without the "sleep" bit it didn't work for me. What it does it that is waits 20 seconds before running the "podman-compose" command. So essentially, your Windows apps won't work for the first 20 seconds after logging in. You can try and see if it works without the "sleep 20 && " at the beginning for you or if a shorter sleep time is sufficient.)_

    2. You can save this bash script, e.g. as `~/bin/winapps_start.sh`.

    3. You also need to make it executable (in KDE's Dolphin file manager: right-click -> `Properties` -> `[x] Executable`, in terminal: `chmod +x winapps_start.sh`)

    4. If you're using KDE Plasma you can add it to the autostart by going to the `System Settings` and then `Autostart` (at the bottom) and click on `+ Add...`, `+ Add Login Script` and then select your script.

    ## Troubleshooting: Orphaned owner files in Microsoft Office

    _I encountered the problem that Microsoft Office will not clean up the owner files on the Linux drive. For example if you open "Book1.xlsx" then Excel will create a file called "~$Book1.xlsx" which is just a few bytes in size and serves the purpose of "locking" this file so other users can't edit it at the same time. Normally these files should be deleted when you close the file, but this didn't happen for whatever reason._

    ### To hide these owner files in KDE's Dolphin file manager:

    1. Go to KDE `System Settings` -> `Default Applications` -> `File Associations`, then search for the mime type corresponding to .xlsx (in this case it's called `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`). Select the existing filename pattern (`*.xlsx`) and click `- Remove` and then click `+ Add` and enter `[!~][!$]*.xlsx`. Do the same for docx and pptx.

    _By default files starting with `~$` have the mime type `application/x-trash`. By making the above change, a file like "~$Book1.xlsx" will be seen as a trash file rather than a spreadsheet._

    2. Open Dolphin, go to `Configure Dolphin` -> `View` and check `[x] Also hide backup files when hiding files`.

    _"Backup files" in this case actually refers to all files with the `application/x-trash` mime type._

    ### To clean up the left-over owner files when you log out:

    1. Create a bash script:

    ```
    #!/bin/bash
    find ~ -type f \( -name '~$*.xlsx' -o -name '~$*.docx' -o -name '~$*.pptx' \) 2>/dev/null -exec rm {} \;
    ```

    _This command will find all files matching the specified patterns (~$*.xlsx, ~$*.docx, and ~$*.pptx) in the home folder (~) and remove them with the `rm` command. `2>/dev/null` is used to suppress any “permission denied” messages for folders you don't have access to._


    2. You can save this bash script, e.g. as `~/bin/office_cleanup.sh`.

    3. You also need to make it executable (in KDE's Dolphin file manager: right-click -> `Properties` -> `[x] Executable`, in terminal: `chmod +x office_cleanup.sh`)

    4. If you're using KDE Plasma you can add it as a script to be run on logout by going to the `System Settings` and then `Autostart` (at the bottom) and click on `+ Add...`, `+ Add Logout Script` and then select your script.


    # Option 2: Using Office 2016 in Crossover (paid)

    ## Step 1: Buy and install Crossover

    @@ -122,7 +277,7 @@ In the registry editor go to `HKEY_CURRENT_USER\Control Panel\International` and
    Now you can close the Crossover window.


    # Option 2: Using Office 2016 in PlayOnLinux
    # Option 3: Using Office 2016 in PlayOnLinux

    This guide is largely based on [this one from Jaydin](https://askubuntu.com/questions/975104/how-do-i-install-ms-office-2016-on-playonlinux) which comes with some helpful screenshots.

    @@ -324,156 +479,4 @@ Then locate your container backup (the msoffice2016_container.tar.gz) an restore

    As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any more security or feature updates, there is no need for them to access the Internet.

    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. As a workaround you can use the `--clone` flag to clone the existing container into a new one, while adding the `--unshare-netns` flag. But I haven't tested it._


    # Option 3: Running any Office version (including 365) with Winapps

    For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for my in July 2024.

    ## Step 1: install required packages

    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. I'll be using Podman in the below instructions.

    For the Winapps app itself, you need `freerdp` to connect to the VM and `dialog` to run the Winapps installer. On my Fedora Kinoite I also needed to install `netcat`. If you are using Podman (or Docker) to run the VM you also need `podman` and `podman-compose` (or the same for Docker)._

    [For required dependencies see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-clone-winapps-repository-and-dependencies)

    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled: `rpm-ostree install podman-compose freerdp dialog netcat`, then reboot.

    In OpenSUSE Tumbleweed: `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd`

    ## Step 2: Download Winapps

    Create a new folder ~/bin/winapps and then run `git clone https://github.com/winapps-org/winapps.git && cd winapps` to download the newest version of Winapps.

    ## Step 3: Spin up the VM

    _The Winapps folder contains a file called compose.yaml which defines your Windows VM. Please refer to the Winapps documentation for details, but we can just keep the default settings which will install "Tiny11" (a minimal version of Windows 11)._

    In the Winapps folder, run this command: `podman-compose --file ./compose.yaml up`

    Then open 127.0.0.1:8006 in the browser to access the Windows VM and check that the installation was successful.

    ## Step 4: Create compose.yaml for Winapps

    Open the compose.yaml and make these two changes below:

    1. For autostart after a reboot, edit the "restart" line: `restart: always`

    2. Then comment out the "oem" line: `#- ./oem:/oem`

    3. Save your edited file here: `~/.config/winapps/compose.yaml`

    ## Step 5: Apply the new configuration

    Still in the Winapps folder, run `podman-compose --file ./compose.yaml down && podman-compose --file ~/.config/winapps/compose.yaml up`

    Again, check that your VM is running in 127.0.0.1:8006. If the user is logged in (i.e. you can see the desktop) then make sure to log out (Start Menu -> click on the username -> Sign Out).

    ## Step 6: Create your Winapps config file

    Create a brand new file called `~/.config/winapps/winapps.conf` (same folder where you saved the compose.yaml), and insert this:

    ```
    RDP_USER="MyWindowsUser"
    RDP_PASS="MyWindowsPassword"
    WAFLAVOR="podman"
    RDP_SCALE=150
    ```

    The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and use scaling on the Linux host already. The example above means 150% scaling.

    ## Step 7: Test Winapps

    In the Winapps folder, run `./installer.sh` which will guide you. In the installer, add Explorer.exe (hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux). It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.

    ## Step 8: Localisation (optional)

    The default VM is set to English US, US keyboard, US timezone etc. To change that, enter the VM (`127.0.0.1:8006` in browser, default password is `MyWindowsPassword`):

    1. Go to Windows settings and set the correct regional format, display language and keyboard layout.

    2. Start the Registry Editor (right-click on start menu, "Run", `regedit`)
    * go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]` and add a new DWORD `IgnoreRemoteKeyboardLayout` with value 1
    * go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]` and add new DWORD `RealTimeIsUniversal` with value 1
    * then reboot the Windows VM

    ## Step 9: Install Microsoft Office or other required applications

    Access the VM through the browser. Then install, for example, Microsoft Office 365 and activate it. **Pirating works** unlike when using Crossover or PlayonLinux.

    ## Step 10: Tidy up Quick Access

    This is automatically set up by Winapps, but I would recommend that in the VM, you add the Linux drive (found in "This PC") to the File Explorer's "Quick Access" and remove the other (useless) folders like Documents and Picutres from the Quick Access.

    ## Step 11: Uninstall Winapps (temporarily)

    This is needed because we previously (in Step 7) just added Explorer.exe and now we want to add the Office apps too.

    1. In the VM, sign out the user (Start Menu -> click on the username -> Sign Out).

    2. Then back in Linux, run `./installer.sh` again and this time select Uninstall.

    ## Step 12: Add Office apps to Linux

    Run `./installer.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint. (Hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux)

    ## Troubleshooting: Prevent Windows auto-login

    _For me, the VM was defaulting to auto-login. However, for Winapps to connect to the VM, the user must be logged out. Otherwise you will just get a black full-screen windows when you attempt to start a Windows app from Linux._

    In the VM (127.0.0.1:8006 in browser), right-click on the start menu, then on "Run", then enter `netplwiz` and check the `[x] Users must enter a user name and password to use this computer` option.

    Then sign out again (Start Menu -> click on the username -> Sign Out).

    ## Troubleshooting: auto-starting the VM

    For me, the Podman container containing the Windows VM didn't auto-start after a computer reboot, even though I set `restart: always` in the the compose.yaml. A workaround would be to create this small bash script and add it to the autostart:

    1. Create the bash script:

    ```
    #!/bin/bash
    sleep 20 && podman-compose --file ~/.config/winapps/compose.yaml start
    ```

    _(I'm not sure why but without the "sleep" bit it didn't work for me. What it does it that is waits 20 seconds before running the "podman-compose" command. So essentially, your Windows apps won't work for the first 20 seconds after logging in. You can try and see if it works without the "sleep 20 && " at the beginning for you or if a shorter sleep time is sufficient.)_

    2. You can save this bash script, e.g. as `~/bin/winapps_start.sh`.

    3. You also need to make it executable (in KDE's Dolphin file manager: right-click -> `Properties` -> `[x] Executable`, in terminal: `chmod +x winapps_start.sh`)

    4. If you're using KDE Plasma you can add it to the autostart by going to the `System Settings` and then `Autostart` (at the bottom) and click on `+ Add...`, `+ Add Login Script` and then select your script.

    ## Troubleshooting: Orphaned owner files in Microsoft Office

    _I encountered the problem that Microsoft Office will not clean up the owner files on the Linux drive. For example if you open "Book1.xlsx" then Excel will create a file called "~$Book1.xlsx" which is just a few bytes in size and serves the purpose of "locking" this file so other users can't edit it at the same time. Normally these files should be deleted when you close the file, but this didn't happen for whatever reason._

    ### To hide these owner files in KDE's Dolphin file manager:

    1. Go to KDE `System Settings` -> `Default Applications` -> `File Associations`, then search for the mime type corresponding to .xlsx (in this case it's called `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`). Select the existing filename pattern (`*.xlsx`) and click `- Remove` and then click `+ Add` and enter `[!~][!$]*.xlsx`. Do the same for docx and pptx.

    _By default files starting with `~$` have the mime type `application/x-trash`. By making the above change, a file like "~$Book1.xlsx" will be seen as a trash file rather than a spreadsheet._

    2. Open Dolphin, go to `Configure Dolphin` -> `View` and check `[x] Also hide backup files when hiding files`.

    _"Backup files" in this case actually refers to all files with the `application/x-trash` mime type._

    ### To clean up the left-over owner files when you log out:

    1. Create a bash script:

    ```
    #!/bin/bash
    find ~ -type f \( -name '~$*.xlsx' -o -name '~$*.docx' -o -name '~$*.pptx' \) 2>/dev/null -exec rm {} \;
    ```

    _This command will find all files matching the specified patterns (~$*.xlsx, ~$*.docx, and ~$*.pptx) in the home folder (~) and remove them with the `rm` command. `2>/dev/null` is used to suppress any “permission denied” messages for folders you don't have access to._


    2. You can save this bash script, e.g. as `~/bin/office_cleanup.sh`.

    3. You also need to make it executable (in KDE's Dolphin file manager: right-click -> `Properties` -> `[x] Executable`, in terminal: `chmod +x office_cleanup.sh`)

    4. If you're using KDE Plasma you can add it as a script to be run on logout by going to the `System Settings` and then `Autostart` (at the bottom) and click on `+ Add...`, `+ Add Logout Script` and then select your script.
    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. As a workaround you can use the `--clone` flag to clone the existing container into a new one, while adding the `--unshare-netns` flag. But I haven't tested it._
  14. @eylenburg eylenburg revised this gist Jul 28, 2024. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -394,9 +394,10 @@ The default VM is set to English US, US keyboard, US timezone etc. To change tha

    1. Go to Windows settings and set the correct regional format, display language and keyboard layout.

    2. If the system time is wrong, go to Time & Date in Windows settings, disable "set time automatically" and manually set the correct time and date and time zone.

    3. Start the Registry Editor (right-click on start menu, "Run", `regedit`), go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]` and add a new DWORD `IgnoreRemoteKeyboardLayout` with value 1, then reboot the VM.
    2. Start the Registry Editor (right-click on start menu, "Run", `regedit`)
    * go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]` and add a new DWORD `IgnoreRemoteKeyboardLayout` with value 1
    * go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]` and add new DWORD `RealTimeIsUniversal` with value 1
    * then reboot the Windows VM

    ## Step 9: Install Microsoft Office or other required applications

  15. @eylenburg eylenburg revised this gist Jul 28, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -386,7 +386,7 @@ The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and u

    ## Step 7: Test Winapps

    In the Winapps folder, run `./installer.sh` which will guide you. In the installer, add Explorer.exe. It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.
    In the Winapps folder, run `./installer.sh` which will guide you. In the installer, add Explorer.exe (hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux). It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.

    ## Step 8: Localisation (optional)

    @@ -416,7 +416,7 @@ This is needed because we previously (in Step 7) just added Explorer.exe and now

    ## Step 12: Add Office apps to Linux

    Run `./installer.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint.
    Run `./installer.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint. (Hint: in the list of installed Windows apps, press "space" to select an app you want to export to Linux)

    ## Troubleshooting: Prevent Windows auto-login

  16. @eylenburg eylenburg revised this gist Jul 28, 2024. 1 changed file with 9 additions and 7 deletions.
    16 changes: 9 additions & 7 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,19 @@
    # Step by step guide: How to install Microsoft Office 2016 in any Linux distribution
    # Step by step guide: How to install Microsoft Office in any Linux distribution

    There are multiple options how to install MS Office on Linux.


    **VM-based** - Integrate Windows apps running in a Windows VM as native-looking in Linux
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits).
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits). **[Decribed below](#option-3-running-any-office-version-including-365-with-winapps)**
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, libvirt/virt-manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

    The VM-based options means can run Office 2021 or Office 365 including all apps, but while the Windows apps themselves run flawlessly (as they're running on real Windows) there's various freerdp-related bugs you may encounter.

    **Wine-based**

    1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies, but [this guy managed to](https://elsotanoenlared.es/office-2016-32-bits-en-linux-con-bottles/)
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script but it is possible with some tinkering (see below). Newer versions of Office are not supported.
    3. Crossover (paid) -> apparently supports Office 2016 and older. It's the easiest way to get a semi-modern office working in Linux without much tinkering.
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script but it is possible with some tinkering (see below). Newer versions of Office are not supported. **[Described below](#option-2-using-office-2016-in-playonlinux)**
    3. Crossover (paid) -> apparently supports Office 2016 and older. It's the easiest way to get a semi-modern office working in Linux without much tinkering. **[Described below](#option-1-using-office-2016-in-crossover-paid)**

    The Wine-based options limit you to Office 2016 or older and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay and quite similar to the newest Office versions, although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).

    @@ -410,19 +410,21 @@ This is automatically set up by Winapps, but I would recommend that in the VM, y

    This is needed because we previously (in Step 7) just added Explorer.exe and now we want to add the Office apps too.

    1. In the VM, sign out the user.
    1. In the VM, sign out the user (Start Menu -> click on the username -> Sign Out).

    2. Then back in Linux, run `./installer.sh` again and this time select Uninstall.

    ## Step 12: Add Office apps to Linux

    Run `./installer.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint.

    ## ## Troubleshooting: Prevent Windows auto-login
    ## Troubleshooting: Prevent Windows auto-login

    _For me, the VM was defaulting to auto-login. However, for Winapps to connect to the VM, the user must be logged out. Otherwise you will just get a black full-screen windows when you attempt to start a Windows app from Linux._

    In the VM (127.0.0.1:8006 in browser), right-click on the start menu, then on "Run", then enter `netplwiz` and check the `Users must enter a user name and password to use this computer` option. Then sign out (Start Menu -> click on the username -> Sign Out).
    In the VM (127.0.0.1:8006 in browser), right-click on the start menu, then on "Run", then enter `netplwiz` and check the `[x] Users must enter a user name and password to use this computer` option.

    Then sign out again (Start Menu -> click on the username -> Sign Out).

    ## Troubleshooting: auto-starting the VM

  17. @eylenburg eylenburg revised this gist Jul 28, 2024. 1 changed file with 156 additions and 6 deletions.
    162 changes: 156 additions & 6 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -4,22 +4,24 @@ There are multiple options how to install MS Office on Linux.


    **VM-based** - Integrate Windows apps running in a Windows VM as native-looking in Linux
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Virt-Manager, and FreeRDP. Still actively maintained (getting Github commits).
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, Virt-Manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits).
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, libvirt/virt-manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

    The VM-based options means can run Office 2021 or Office 365 including all apps, but for me it was quite buggy and when I encounterd some (FreeRDP-related?) bug in both Winapps and Cassowary that meant I could only start Excel with an external screen plugged in, I gave up. [bug](https://github.com/winapps-org/winapps/issues/65)
    The VM-based options means can run Office 2021 or Office 365 including all apps, but while the Windows apps themselves run flawlessly (as they're running on real Windows) there's various freerdp-related bugs you may encounter.

    **Wine-based**

    1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies
    1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies, but [this guy managed to](https://elsotanoenlared.es/office-2016-32-bits-en-linux-con-bottles/)
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script but it is possible with some tinkering (see below). Newer versions of Office are not supported.
    3. Crossover (paid) -> apparently supports Office 2016 and older. It's the easiest way to get a semi-modern office working in Linux without much tinkering.

    The Wine-based options limit you to Office 2016 or older and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay and quite similar to the newest Office versions, although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).

    **[Option 1: Using Office 2016 in Crossover (paid)](#option-1-using-office-2016-in-crossover-paid)**

    **[Option 2: Using Office 2016 in PlayOnLinux (free)](#option-2-using-office-2016-in-playonlinux-free)**
    **[Option 2: Using Office 2016 in PlayOnLinux](#option-2-using-office-2016-in-playonlinux)**

    **[Option 3: Running any Office version (including 365) with Winapps](#option-3-running-any-office-version-including-365-with-winapps)**


    # Option 1: Using Office 2016 in Crossover (paid)
    @@ -120,7 +122,7 @@ In the registry editor go to `HKEY_CURRENT_USER\Control Panel\International` and
    Now you can close the Crossover window.


    # Option 2: Using Office 2016 in PlayOnLinux (free)
    # Option 2: Using Office 2016 in PlayOnLinux

    This guide is largely based on [this one from Jaydin](https://askubuntu.com/questions/975104/how-do-i-install-ms-office-2016-on-playonlinux) which comes with some helpful screenshots.

    @@ -324,3 +326,151 @@ As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any

    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. As a workaround you can use the `--clone` flag to clone the existing container into a new one, while adding the `--unshare-netns` flag. But I haven't tested it._


    # Option 3: Running any Office version (including 365) with Winapps

    For steps 1-6 you should [check the official documentation](https://github.com/winapps-org/winapps) as it may have changed. The below steps worked for my in July 2024.

    ## Step 1: install required packages

    _Winapps requires either Docker or Podman to run the Windows VM and can also work with an existing VM that you manage with libvirt and Virt-Manager. I'll be using Podman in the below instructions.

    For the Winapps app itself, you need `freerdp` to connect to the VM and `dialog` to run the Winapps installer. On my Fedora Kinoite I also needed to install `netcat`. If you are using Podman (or Docker) to run the VM you also need `podman` and `podman-compose` (or the same for Docker)._

    [For required dependencies see here](https://github.com/winapps-org/winapps?tab=readme-ov-file#step-2-clone-winapps-repository-and-dependencies)

    In Fedora Atomic (Kinoite/Silverblue), which has podman preinstalled: `rpm-ostree install podman-compose freerdp dialog netcat`, then reboot.

    In OpenSUSE Tumbleweed: `sudo zypper install podman podman-compose freerdp dialog netcat-openbsd`

    ## Step 2: Download Winapps

    Create a new folder ~/bin/winapps and then run `git clone https://github.com/winapps-org/winapps.git && cd winapps` to download the newest version of Winapps.

    ## Step 3: Spin up the VM

    _The Winapps folder contains a file called compose.yaml which defines your Windows VM. Please refer to the Winapps documentation for details, but we can just keep the default settings which will install "Tiny11" (a minimal version of Windows 11)._

    In the Winapps folder, run this command: `podman-compose --file ./compose.yaml up`

    Then open 127.0.0.1:8006 in the browser to access the Windows VM and check that the installation was successful.

    ## Step 4: Create compose.yaml for Winapps

    Open the compose.yaml and make these two changes below:

    1. For autostart after a reboot, edit the "restart" line: `restart: always`

    2. Then comment out the "oem" line: `#- ./oem:/oem`

    3. Save your edited file here: `~/.config/winapps/compose.yaml`

    ## Step 5: Apply the new configuration

    Still in the Winapps folder, run `podman-compose --file ./compose.yaml down && podman-compose --file ~/.config/winapps/compose.yaml up`

    Again, check that your VM is running in 127.0.0.1:8006. If the user is logged in (i.e. you can see the desktop) then make sure to log out (Start Menu -> click on the username -> Sign Out).

    ## Step 6: Create your Winapps config file

    Create a brand new file called `~/.config/winapps/winapps.conf` (same folder where you saved the compose.yaml), and insert this:

    ```
    RDP_USER="MyWindowsUser"
    RDP_PASS="MyWindowsPassword"
    WAFLAVOR="podman"
    RDP_SCALE=150
    ```

    The RDP_SCALE line is optional, it is useful when you have a HiDPI monitor and use scaling on the Linux host already. The example above means 150% scaling.

    ## Step 7: Test Winapps

    In the Winapps folder, run `./installer.sh` which will guide you. In the installer, add Explorer.exe. It should now appear in your Linux menu so you can test if it works and you get a Windows Explorer window when launched from Linux.

    ## Step 8: Localisation (optional)

    The default VM is set to English US, US keyboard, US timezone etc. To change that, enter the VM (`127.0.0.1:8006` in browser, default password is `MyWindowsPassword`):

    1. Go to Windows settings and set the correct regional format, display language and keyboard layout.

    2. If the system time is wrong, go to Time & Date in Windows settings, disable "set time automatically" and manually set the correct time and date and time zone.

    3. Start the Registry Editor (right-click on start menu, "Run", `regedit`), go to `[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]` and add a new DWORD `IgnoreRemoteKeyboardLayout` with value 1, then reboot the VM.

    ## Step 9: Install Microsoft Office or other required applications

    Access the VM through the browser. Then install, for example, Microsoft Office 365 and activate it. **Pirating works** unlike when using Crossover or PlayonLinux.

    ## Step 10: Tidy up Quick Access

    This is automatically set up by Winapps, but I would recommend that in the VM, you add the Linux drive (found in "This PC") to the File Explorer's "Quick Access" and remove the other (useless) folders like Documents and Picutres from the Quick Access.

    ## Step 11: Uninstall Winapps (temporarily)

    This is needed because we previously (in Step 7) just added Explorer.exe and now we want to add the Office apps too.

    1. In the VM, sign out the user.

    2. Then back in Linux, run `./installer.sh` again and this time select Uninstall.

    ## Step 12: Add Office apps to Linux

    Run `./installer.sh` another time and this time select "Install" and select all the required apps, e.g. Excel, Word and Powerpoint.

    ## ## Troubleshooting: Prevent Windows auto-login

    _For me, the VM was defaulting to auto-login. However, for Winapps to connect to the VM, the user must be logged out. Otherwise you will just get a black full-screen windows when you attempt to start a Windows app from Linux._

    In the VM (127.0.0.1:8006 in browser), right-click on the start menu, then on "Run", then enter `netplwiz` and check the `Users must enter a user name and password to use this computer` option. Then sign out (Start Menu -> click on the username -> Sign Out).

    ## Troubleshooting: auto-starting the VM

    For me, the Podman container containing the Windows VM didn't auto-start after a computer reboot, even though I set `restart: always` in the the compose.yaml. A workaround would be to create this small bash script and add it to the autostart:

    1. Create the bash script:

    ```
    #!/bin/bash
    sleep 20 && podman-compose --file ~/.config/winapps/compose.yaml start
    ```

    _(I'm not sure why but without the "sleep" bit it didn't work for me. What it does it that is waits 20 seconds before running the "podman-compose" command. So essentially, your Windows apps won't work for the first 20 seconds after logging in. You can try and see if it works without the "sleep 20 && " at the beginning for you or if a shorter sleep time is sufficient.)_

    2. You can save this bash script, e.g. as `~/bin/winapps_start.sh`.

    3. You also need to make it executable (in KDE's Dolphin file manager: right-click -> `Properties` -> `[x] Executable`, in terminal: `chmod +x winapps_start.sh`)

    4. If you're using KDE Plasma you can add it to the autostart by going to the `System Settings` and then `Autostart` (at the bottom) and click on `+ Add...`, `+ Add Login Script` and then select your script.

    ## Troubleshooting: Orphaned owner files in Microsoft Office

    _I encountered the problem that Microsoft Office will not clean up the owner files on the Linux drive. For example if you open "Book1.xlsx" then Excel will create a file called "~$Book1.xlsx" which is just a few bytes in size and serves the purpose of "locking" this file so other users can't edit it at the same time. Normally these files should be deleted when you close the file, but this didn't happen for whatever reason._

    ### To hide these owner files in KDE's Dolphin file manager:

    1. Go to KDE `System Settings` -> `Default Applications` -> `File Associations`, then search for the mime type corresponding to .xlsx (in this case it's called `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`). Select the existing filename pattern (`*.xlsx`) and click `- Remove` and then click `+ Add` and enter `[!~][!$]*.xlsx`. Do the same for docx and pptx.

    _By default files starting with `~$` have the mime type `application/x-trash`. By making the above change, a file like "~$Book1.xlsx" will be seen as a trash file rather than a spreadsheet._

    2. Open Dolphin, go to `Configure Dolphin` -> `View` and check `[x] Also hide backup files when hiding files`.

    _"Backup files" in this case actually refers to all files with the `application/x-trash` mime type._

    ### To clean up the left-over owner files when you log out:

    1. Create a bash script:

    ```
    #!/bin/bash
    find ~ -type f \( -name '~$*.xlsx' -o -name '~$*.docx' -o -name '~$*.pptx' \) 2>/dev/null -exec rm {} \;
    ```

    _This command will find all files matching the specified patterns (~$*.xlsx, ~$*.docx, and ~$*.pptx) in the home folder (~) and remove them with the `rm` command. `2>/dev/null` is used to suppress any “permission denied” messages for folders you don't have access to._


    2. You can save this bash script, e.g. as `~/bin/office_cleanup.sh`.

    3. You also need to make it executable (in KDE's Dolphin file manager: right-click -> `Properties` -> `[x] Executable`, in terminal: `chmod +x office_cleanup.sh`)

    4. If you're using KDE Plasma you can add it as a script to be run on logout by going to the `System Settings` and then `Autostart` (at the bottom) and click on `+ Add...`, `+ Add Logout Script` and then select your script.
  18. @eylenburg eylenburg revised this gist Jul 27, 2024. 1 changed file with 111 additions and 4 deletions.
    115 changes: 111 additions & 4 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -12,15 +12,118 @@ The VM-based options means can run Office 2021 or Office 365 including all apps,
    **Wine-based**

    1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script. Newer versions not supported.
    3. Crossover (paid) -> apparently supports Office 2016 and older. I didn't try it but it seems to be the easiest way to get a semi-modern office working in Linux.
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script but it is possible with some tinkering (see below). Newer versions of Office are not supported.
    3. Crossover (paid) -> apparently supports Office 2016 and older. It's the easiest way to get a semi-modern office working in Linux without much tinkering.

    The Wine-based options limit you to Office 2016 or older and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay and quite similar to the newest Office versions, although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).

    **[Option 1: Using Office 2016 in Crossover (paid)](#option-1-using-office-2016-in-crossover-paid)**

    **[Option 2: Using Office 2016 in PlayOnLinux (free)](#option-2-using-office-2016-in-playonlinux-free)**


    # Option 1: Using Office 2016 in Crossover (paid)

    ## Step 1: Buy and install Crossover

    ### On Ubuntu, Debian, Mint, Fedora

    These distributions are officially supported by [Crossover](https://www.codeweavers.com/crossover/) so just install it and follow the in-app instructions on how to install Microsoft Office 2016.

    ### On other distributions (e.g. OpenSUSE, Arch, Mageia, OpenMandriva)

    OpenSUSE can run the RPM for Fedora, but it's not tested by the Crossover team. For other distros, there's a generic installer available.

    ### On immutable distributions like Fedora Atomic (Kinoite/Silverblue)

    The problem here is not installing Crossover itself (you could just layer the RPM) but that Crossover expects to be able to install all other (many) the packages that MS Office 2016 requires. The below is a guide on how to install it in a Distrobox instead.

    Prerequisite: You have bought a license for MS Office 2016 and for Codeweavers Crossover. Also you have the installer for MS Office 2016 downloaded already.

    **1. Install distrobox:**

    ```rpm-ostree install distrobox``` then reboot to apply changes.


    **2. Create a new distrobox container.** This should be one of the officially supported distributions for Crossover (e.g. Debian, Fedora, Ubuntu). In this example I'll go with Debian Sid because it's rolling so you won't ever have to think about upgrading your container distro to the next version.

    ```distrobox-create --name debian --image docker.io/library/debian:testing```

    **3. Some preparations**

    ```distrobox enter debian```

    ```sudo apt install gdebi```

    ```sudo dpkg --add-architecture i386```

    **4. Install Crossover**

    Still in the Distrobox:

    ```wget http://crossover.codeweavers.com/redirect/crossover.deb```

    ```sudo gdebi crossover.deb```

    **5. Register your Crossover license**

    Still in the Distrobox:

    ```sudo /opt/cxoffice/bin/crossover``` (need to start Crossover as root to register your license)

    then register you license in the app and close the app.

    **6. Install dependencies for Office 2016**

    Still in the Distrobox:

    ```sudo apt install gdebi libc6:i386 gstreamer1.0-plugins-base:amd64 gstreamer1.0-plugins-base:i386 gstreamer1.0-plugins-good:amd64 gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-ugly:amd64 gstreamer1.0-plugins-ugly:i386 libc6:i386 libcups2:i386 libdbus-1-3:i386 libfontconfig1:i386 libfreetype6:i386 libgcc-s1:i386 libgl1-mesa-dri:i386 libgl1:i386 libgnutls30:i386 libgstreamer1.0-0:amd64 libgstreamer1.0-0:i386 libnss-mdns:i386 libpcsclite1:i386 libpulse0:i386 libsane1:amd64 libsane1:i386 libudev1:i386 libunwind8:amd64 libvulkan1:i386 libx11-6:i386 libxcomposite1:i386 libxcursor1:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxrandr2:i386 libxrender1:i386 libxxf86vm1:i386```

    **7. Install Office 2016**

    Still in the Distrobox:

    ```/opt/cxoffice/bin/crossover``` to start Crossover as a normal user

    then install Office 2016 through the GUI.

    **8. Create starters that work in your host system**

    To export the desktop files, enter these commands in the distrobox container:

    ```distrobox-export --app 'PowerPoint 2016'```

    ```distrobox-export --app 'Word 2016'```

    ```distrobox-export --app 'Excel 2016'```

    If it doesn't work because the starters are missing in the container, open Crossover again (`/opt/cxoffice/bin/crossover`), select the Office 2016 bottle, click on `Edit Menus` and then `Recreate`.

    Finally enter ```logout``` in the distrobox terminal.

    **9. Get rid of broken starters that don't work in your host system**

    Finally you can optionally delete all files starting with "cx" in `~/.local/share/applications`, as these only work when called from the distrobox container but not from the host.

    ## Step 2: Tweaks after the Microsoft Office installation

    **1. Register Office**

    From the Crossover window, start one of the programs (Word, Excel, Powerpoint) and enter your license key (this can be found in your purchase history on office.com - it's not the same key as what's found in the box if your bought a physical copy).

    **2. (optional) Fix date format**

    By default, the date format is American (mm/dd/yyyy). To change it in Crossover, click on "Run command" in your bottle, then enter the command `regedit`.

    In the registry editor go to `HKEY_CURRENT_USER\Control Panel\International` and change `sShortDate` (e.g. from M/d/yyyy to d/M/yyyy). Then close the window and click on `Simulate Reboot` in the Crossover bottle.

    Now you can close the Crossover window.


    # Option 2: Using Office 2016 in PlayOnLinux (free)

    This guide is largely based on [this one from Jaydin](https://askubuntu.com/questions/975104/how-do-i-install-ms-office-2016-on-playonlinux) which comes with some helpful screenshots.

    ## Step by step guide for Office 2016

    ### Step 0: Get Office

    Log in to your Microsoft account, download the MS Office "offline" image (multiple GB, ending in .img) and note down your product key (this can also be found in your Microsoft account at the same place where you download the .img file)
    @@ -35,6 +138,8 @@ For example `mkdir ~/msoffice/msoffice2016/image && sudo mount -o loop Office201

    ### Step 2: Install Distrobox:

    This is recommended to keep the various Wine packages separate from your system and to be able to nuke the container and start afresh if something goes wrong or stops working.

    * OpenSUSE: `sudo zypper install distrobox podman` (or install through Yast Software)
    * OpenSUSE Kalpa/Aeon: already preinstalled
    * Fedora: `sudo dnf install distrobox`
    @@ -82,6 +187,8 @@ Still in the Distrobox, enter the command `playonlinux` to start PlayOnLinux in

    Click on `Tools -> Manage Wine Versions` and in the `Wine versions (x86)` tab select version `4.15` and click on `>` to start the installation of this Wine version.

    _Note: version 4.15 is ancient and Office will probably be running more stable on a newer version of Wine, but in my tests it failed with other/newer versions while 4.15 at least it proven to kind of work._

    You'll be asked to install Wine Mono and Wine Gecko. Install both.

    On the PlayOnLinux main window, click `Configure` and then `New` in the bottom left to create a virtual drive.
  19. @eylenburg eylenburg revised this gist Nov 21, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -215,5 +215,5 @@ Then locate your container backup (the msoffice2016_container.tar.gz) an restore

    As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any more security or feature updates, there is no need for them to access the Internet.

    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. Perhaps you could back up your container, delete it, and restore it while adding `--unshare-netns` to the end of the restore command above. But I haven't tested it._
    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. As a workaround you can use the `--clone` flag to clone the existing container into a new one, while adding the `--unshare-netns` flag. But I haven't tested it._

  20. @eylenburg eylenburg revised this gist Nov 18, 2023. 1 changed file with 0 additions and 7 deletions.
    7 changes: 0 additions & 7 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -217,10 +217,3 @@ As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any

    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. Perhaps you could back up your container, delete it, and restore it while adding `--unshare-netns` to the end of the restore command above. But I haven't tested it._

    ---

    ### Step 15: Force the Distrobox Container to use Xorg rather than Wayland (optional)

    There's reports that Office 2016 is buggy and prone to crashes when running under Wayland. The easiest solution would be to not use Wayland in the first place, because it will transpire to the Distrobox container.

    _At this point I haven't found a good way to run a Wayland session but have Office/Wine/Distrobox use Xorg instead. Stay tuned._
  21. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -215,4 +215,12 @@ Then locate your container backup (the msoffice2016_container.tar.gz) an restore

    As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any more security or feature updates, there is no need for them to access the Internet.

    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. Perhaps you could back up your container, delete it, and restore it while adding `--unshare-netns` to the end of the restore command above. But I haven't tested it._
    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. Perhaps you could back up your container, delete it, and restore it while adding `--unshare-netns` to the end of the restore command above. But I haven't tested it._

    ---

    ### Step 15: Force the Distrobox Container to use Xorg rather than Wayland (optional)

    There's reports that Office 2016 is buggy and prone to crashes when running under Wayland. The easiest solution would be to not use Wayland in the first place, because it will transpire to the Distrobox container.

    _At this point I haven't found a good way to run a Wayland session but have Office/Wine/Distrobox use Xorg instead. Stay tuned._
  22. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -174,7 +174,7 @@ By default Excel will use American settings, for example if you enter 1/12/23 Ex

    Start PlayOnLinux in Distrobox again with `distrobox enter msoffice2016 && playonlinux`

    Start the registry editor again (o to `Configure` -> select the `msoffice2016` virtual drive on the left -> `Wine` tab -> `Registry Editor`)
    Start the registry editor again (go to `Configure` -> select the `msoffice2016` virtual drive on the left -> `Wine` tab -> `Registry Editor`)

    Navigate to `HKEY_CURRENT_USER\Control Panel\International` and start editing some of the values. A good overview is [here](https://renenyffenegger.ch/notes/Windows/registry/tree/HKEY_CURRENT_USER/Control-Panel/International/index). For example for UK settings, you can use:
    ```
    @@ -201,11 +201,11 @@ Navigate to `HKEY_CURRENT_USER\Control Panel\International` and start editing so

    Back up your container: `podman container commit -p msoffice2016 msoffice2016_container && podman save msoffice2016_container:latest | gzip > msoffice2016_container.tar.gz` (see [here](https://github.com/89luca89/distrobox/blob/main/docs/useful_tips.md#container-save-and-restore) for the official documentation)

    Then back up your container's /home folder by creating an archive (.tar.gz, .zip, whatever) of your complete ~/msoffice/msoffice2016 folder, or whatever location you chose (good that you set up a separate /home folder, right?).
    Then back up your container's /home folder by creating an archive (.tar.gz, .zip, whatever) of your complete `~/msoffice/msoffice2016` folder, or whatever location you chose (good that you set up a separate /home folder, right?).

    _to restore your backup:_

    Create a new empty folder ~/msoffice (delete the old one if needed) and extract the contents of your /home folder backup. Now you should have restored your old container /home folder in ~/msoffice/msoffice2016.
    Create a new empty folder ~/msoffice (delete the old one if needed) and extract the contents of your /home folder backup. Now you should have restored your old container /home folder in `~/msoffice/msoffice2016`.

    Then locate your container backup (the msoffice2016_container.tar.gz) an restore the container by running the command `podman load < msoffice2016_container.tar.gz && distrobox-create --name msoffice2016 --image msoffice2016_container:latest --home ~/msoffice/msoffice2016/`

  23. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -49,7 +49,7 @@ For example `mkdir ~/msoffice/msoffice2016/image && sudo mount -o loop Office201

    We will be using a Ubuntu 18.04 container because this is the last version supporting 32-bit packages. Yes, Ubuntu 18.04 is end-of-life and won't get any more security updates, but the same is true for Office 2016.

    I would recommend to have a separate /home folder for the distrobox container to avoid mixing files with your normal /home folder and to make backup and restore easier. For the below example I have created folder called ~/msoffice/msoffice2016 which I will use as the container's /home folder.
    I would recommend to have a separate /home folder for the distrobox container to avoid mixing files with your normal /home folder and to make backup and restore easier. For the below example I have created folder called `~/msoffice/msoffice2016` which I will use as the container's /home folder.

    Enter this command to create and enter your Ubuntu 18.04 distrobox:

    @@ -78,7 +78,7 @@ and follow the .NET installation wizard that pops up.

    ### Step 5: Prepare PlayOnLinux

    enter the command `playonlinux` to start PlayOnLinux in the Ubuntu container
    Still in the Distrobox, enter the command `playonlinux` to start PlayOnLinux in the Ubuntu container

    Click on `Tools -> Manage Wine Versions` and in the `Wine versions (x86)` tab select version `4.15` and click on `>` to start the installation of this Wine version.

  24. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -2,19 +2,20 @@

    There are multiple options how to install MS Office on Linux.

    **Wine-based**

    1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script. Newer versions not supported.
    3. Crossover (paid) -> apparently supports Office 2016 and older. I didn't try it but it seems to be the easiest way to get a semi-modern office working in Linux.

    **VM-based** - Integrate Windows apps running in a Windows VM as native-looking in Linux
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Virt-Manager, and FreeRDP. Still actively maintained (getting Github commits).
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, Virt-Manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

    The VM-based options means can run Office 2021 or Office 365 including all apps, but for me it was quite buggy and when I encounterd some (FreeRDP-related?) bug in both Winapps and Cassowary that meant I could only start Excel with an external screen plugged in, I gave up. [bug](https://github.com/winapps-org/winapps/issues/65)

    The first option limits you to Office 2016 and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).
    **Wine-based**

    1. Bottles -> didn't work for me, probably because you can't install 32-bit dependencies
    2. PlayOnLinux -> the Office 2010 script worked for me, Office 2013 script not tested, Office 2016 failed to install with their script. Newer versions not supported.
    3. Crossover (paid) -> apparently supports Office 2016 and older. I didn't try it but it seems to be the easiest way to get a semi-modern office working in Linux.

    The Wine-based options limit you to Office 2016 or older and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay and quite similar to the newest Office versions, although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).

    This guide is largely based on [this one from Jaydin](https://askubuntu.com/questions/975104/how-do-i-install-ms-office-2016-on-playonlinux) which comes with some helpful screenshots.

  25. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ There are multiple options how to install MS Office on Linux.
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Virt-Manager, and FreeRDP. Still actively maintained (getting Github commits).
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, Virt-Manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

    The latter option means you can run Office 2021 or Office 365 including all apps, but for me it was quite buggy and when I encounterd some (FreeRDP-related?) bug in both Winapps and Cassowary that meant I could only start Excel with an external screen plugged in, I gave up. [bug](https://github.com/winapps-org/winapps/issues/65)
    The VM-based options means can run Office 2021 or Office 365 including all apps, but for me it was quite buggy and when I encounterd some (FreeRDP-related?) bug in both Winapps and Cassowary that meant I could only start Excel with an external screen plugged in, I gave up. [bug](https://github.com/winapps-org/winapps/issues/65)

    The first option limits you to Office 2016 and only the core apps (Excel, Powerpoint, Word) are working. Office 2016 is still mostly okay although you're going to miss out on some useful Excel function like `IFS`, `MINIFS`, `MAXIFS`, `XLOOKUP`, `UNIQUE`, and `SWITCH` ([see here for a full list](https://bettersolutions.com/excel/functions/updates.htm)).

  26. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ There are multiple options how to install MS Office on Linux.

    **VM-based** - Integrate Windows apps running in a Windows VM as native-looking in Linux
    1. [Winapps](https://github.com/winapps-org/winapps), based on KVM, QEMU, Virt-Manager, and FreeRDP. Still actively maintained (getting Github commits).
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, Virt-Manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use.
    2. [Cassowary](https://github.com/casualsnek/cassowary), based on KVM, QEMU, Virt-Manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

    The latter option means you can run Office 2021 or Office 365 including all apps, but for me it was quite buggy and when I encounterd some (FreeRDP-related?) bug in both Winapps and Cassowary that meant I could only start Excel with an external screen plugged in, I gave up. [bug](https://github.com/winapps-org/winapps/issues/65)

  27. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -169,7 +169,7 @@ Now, next time you see e.g. an `.xlsx` file you can right-click on the file -> `

    ### Step 12: Fix locale settings (optional)

    By default Excel will use American settings, for example if you enter 1/12/23 Excel will think it is the 12th of January rather than the 1st of December. Or I you're European you'll want to use "." as a thousand separator and "," as a decimal separator rather than the other way round. To fix this:
    By default Excel will use American settings, for example if you enter 1/12/23 Excel will think it is the 12th of January rather than the 1st of December. Or if you're European you'll want to use "." as a thousand separator and "," as a decimal separator rather than the other way round. To fix stuff like this:

    Start PlayOnLinux in Distrobox again with `distrobox enter msoffice2016 && playonlinux`

    @@ -196,7 +196,7 @@ Navigate to `HKEY_CURRENT_USER\Control Panel\International` and start editing so

    ---

    ### Step 13: backup your set-up (optional)
    ### Step 13: Backup your set-up (optional)

    Back up your container: `podman container commit -p msoffice2016 msoffice2016_container && podman save msoffice2016_container:latest | gzip > msoffice2016_container.tar.gz` (see [here](https://github.com/89luca89/distrobox/blob/main/docs/useful_tips.md#container-save-and-restore) for the official documentation)

    @@ -210,7 +210,7 @@ Then locate your container backup (the msoffice2016_container.tar.gz) an restore

    ---

    ### Step 14: disable Internet access for the container
    ### Step 14: Disable Internet access for the container (optional)

    As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any more security or feature updates, there is no need for them to access the Internet.

  28. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 18 additions and 16 deletions.
    34 changes: 18 additions & 16 deletions msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Step by step guide: How to install Microsoft Office 2016 in any Linux distribution

    There are multiple options how to install MS Office on Linux.

    **Wine-based**
    @@ -16,21 +18,21 @@ The first option limits you to Office 2016 and only the core apps (Excel, Powerp

    This guide is largely based on [this one from Jaydin](https://askubuntu.com/questions/975104/how-do-i-install-ms-office-2016-on-playonlinux) which comes with some helpful screenshots.

    **Step by step guide for Office 2016**
    ## Step by step guide for Office 2016

    Step 0: Get Office
    ### Step 0: Get Office

    Log in to your Microsoft account, download the MS Office "offline" image (multiple GB, ending in .img) and note down your product key (this can also be found in your Microsoft account at the same place where you download the .img file)

    ---

    Step 1: Mount the installation disk
    ### Step 1: Mount the installation disk

    For example `mkdir ~/msoffice/msoffice2016/image && sudo mount -o loop Office2016HomeStudentRetail.img ~/msoffice/msoffice2016/image/`

    ---

    Step 2: Install Distrobox:
    ### Step 2: Install Distrobox:

    * OpenSUSE: `sudo zypper install distrobox podman` (or install through Yast Software)
    * OpenSUSE Kalpa/Aeon: already preinstalled
    @@ -42,7 +44,7 @@ Step 2: Install Distrobox:

    ---

    Step 3: Set up your container
    ### Step 3: Set up your container

    We will be using a Ubuntu 18.04 container because this is the last version supporting 32-bit packages. Yes, Ubuntu 18.04 is end-of-life and won't get any more security updates, but the same is true for Office 2016.

    @@ -54,7 +56,7 @@ Enter this command to create and enter your Ubuntu 18.04 distrobox:

    ---

    Step 4: Set up PlayOnLinux in container
    ### Step 4: Set up PlayOnLinux in container

    Now you're inside the Distrobox container with Ubuntu 18.04. Enter these commands:

    @@ -73,7 +75,7 @@ and follow the .NET installation wizard that pops up.

    ---

    Step 5: Prepare PlayOnLinux
    ### Step 5: Prepare PlayOnLinux

    enter the command `playonlinux` to start PlayOnLinux in the Ubuntu container

    @@ -100,7 +102,7 @@ Still in the `Wine` tab, click on `Registry Editor`.

    ---

    Step 6: Install Office
    ### Step 6: Install Office

    In the PlayOnLinux configuration screen, click on the `Miscellaneous` tab and then `Run a .exe file in this virtual drive`. A file picker will pop up. Navigate yourself to where you have mounted installation disc (in this example /home/user/msoffice/msoffice2016/image/). Enter the `Office` folder and select the file `Setup32.exe`.

    @@ -110,15 +112,15 @@ When the installation is complete, or you _think_ it may have completed, close t

    ---

    Step 7: Finishing up
    ### Step 7: Finishing up

    Start your file manager (e.g. Dolphin or Gnome Files) and go the wineprefix folder set up by PlayOnLinux. In my example this would be in `~/msoffice/msoffice2016/.PlayOnLinux/wineprefix/msoffice2016/` and from there continue navigating to `drive_c/Program Files/Common Files/Microsoft Shared/ClickToRun/`.

    Find the files `AppvIsvSubsystems32.dll` and `C2R32.dll` and copy them to `drive_c/Program Files/Microsoft Office/root/Office16/`

    ---

    Step 8: Defining apps in PlayOnLinux
    ### Step 8: Defining apps in PlayOnLinux

    Go back to the PlayOnLinux window and click on `Configure` (make sure `msoffice2016` or whatever you named your virtual drive is selected on the left).

    @@ -128,23 +130,23 @@ Now PlayOnLinux will search for .exe files on the virtual drive. Select `EXCEL.E

    ---

    Step 9: Test and activate Office
    ### Step 9: Test and activate Office

    On the PlayOnLinux main screen, you'll now see the three apps Excel, Word and Powerpoint. Click on one of them and then on `Run` to start the app. Hopefully it will start and run without crashing!

    You'll get asked for your product key. Enter the one you got from your Microsoft account or Office.com. Logging in your the Microsoft account from within Office either doesn't work or crash the application, so you won't be able to log in (for Onedrive etc) but Office still says that it's activated when you use the product key.

    ---

    Step 10: Unmount disc
    ### Step 10: Unmount disc

    Close all Office windows, close PlayOnLinux, then leave your Distrobox by typing `logout` in the terminal.

    `sudo umount ~/msoffice/msoffice2016/image` (adjust path accordingly) to unmount the installation disc.

    ---

    Step 11: Add .desktop entries
    ### Step 11: Add .desktop entries

    In KDE, right-click on the start menu and select `Edit Applications`.

    @@ -165,7 +167,7 @@ Now, next time you see e.g. an `.xlsx` file you can right-click on the file -> `

    ---

    Step 12: Fix locale settings (optional)
    ### Step 12: Fix locale settings (optional)

    By default Excel will use American settings, for example if you enter 1/12/23 Excel will think it is the 12th of January rather than the 1st of December. Or I you're European you'll want to use "." as a thousand separator and "," as a decimal separator rather than the other way round. To fix this:

    @@ -194,7 +196,7 @@ Navigate to `HKEY_CURRENT_USER\Control Panel\International` and start editing so

    ---

    Step 13: backup your set-up (optional)
    ### Step 13: backup your set-up (optional)

    Back up your container: `podman container commit -p msoffice2016 msoffice2016_container && podman save msoffice2016_container:latest | gzip > msoffice2016_container.tar.gz` (see [here](https://github.com/89luca89/distrobox/blob/main/docs/useful_tips.md#container-save-and-restore) for the official documentation)

    @@ -208,7 +210,7 @@ Then locate your container backup (the msoffice2016_container.tar.gz) an restore

    ---

    Step 14: disable Internet access for the container
    ### Step 14: disable Internet access for the container

    As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any more security or feature updates, there is no need for them to access the Internet.

  29. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -204,4 +204,12 @@ _to restore your backup:_

    Create a new empty folder ~/msoffice (delete the old one if needed) and extract the contents of your /home folder backup. Now you should have restored your old container /home folder in ~/msoffice/msoffice2016.

    Then locate your container backup (the msoffice2016_container.tar.gz) an restore the container by running the command `podman load < msoffice2016_container.tar.gz && distrobox-create --name msoffice2016 --image msoffice2016_container:latest --home ~/msoffice/msoffice2016/`
    Then locate your container backup (the msoffice2016_container.tar.gz) an restore the container by running the command `podman load < msoffice2016_container.tar.gz && distrobox-create --name msoffice2016 --image msoffice2016_container:latest --home ~/msoffice/msoffice2016/`

    ---

    Step 14: disable Internet access for the container

    As both Office 2016 and Ubuntu 18.04 are "end of life", and will not receive any more security or feature updates, there is no need for them to access the Internet.

    _At this point I haven't found a good way to disable Internet access to the container. You'll need Internet for the initial set-up of the container. Perhaps you could back up your container, delete it, and restore it while adding `--unshare-netns` to the end of the restore command above. But I haven't tested it._
  30. @eylenburg eylenburg revised this gist Nov 17, 2023. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion msoffice_in_linux.md
    Original file line number Diff line number Diff line change
    @@ -155,6 +155,8 @@ Define it like this:
    * Program = `/usr/bin/distrobox`
    * Command-Line Arguments: `enter -n msoffice2016 -e 'playonlinux --run Excel'` (where msoffice2016 is the name of your Distrobox container)

    _In Gnome or Xfce you may have to define your .desktop files manually, like described [here](https://medium.com/@insomniocode/linux-creating-a-desktop-shortcut-launcher-2088d1e3c83e). It should read `Exec=/usr/bin/distrobox enter -n msoffice2016 -e 'playonlinux --run Excel'`_

    Then do the same for Word and Powerpoint.

    If you want, you can add logos as well (download them from Wikipedia for example).
    @@ -188,6 +190,7 @@ Navigate to `HKEY_CURRENT_USER\Control Panel\International` and start editing so
    "sTimeFormat"="HH:mm:ss"
    "sShortTime"="HH:mm"
    "sYearMonth"="MMMM yyyy"
    ```

    ---

    @@ -197,7 +200,7 @@ Back up your container: `podman container commit -p msoffice2016 msoffice2016_co

    Then back up your container's /home folder by creating an archive (.tar.gz, .zip, whatever) of your complete ~/msoffice/msoffice2016 folder, or whatever location you chose (good that you set up a separate /home folder, right?).

    **to restore your backup:**
    _to restore your backup:_

    Create a new empty folder ~/msoffice (delete the old one if needed) and extract the contents of your /home folder backup. Now you should have restored your old container /home folder in ~/msoffice/msoffice2016.