Installing OneDrive and Microsoft Office365 on Linux - DanaResearchGroup/wiki GitHub Wiki
Currently, there are no solutions provided by Microsoft for installing OneDrive and Microsoft Office on Linux. Therefore, we will need to use third party open source solutions.
Important: If you are to go with Solution 1 for Microsoft Office 365 installation, then ensure you have completed the OneDrive set up as this is required!
The current open source solution is to use a Command-Line Interface (CLI) of OneDrive in combination with another open source project that provides a GUI.
The CLI will be the backbone of connecting and syncing with your OneDrive account. The GUI will provide you with visual information of what is being synced (and other advanced options).
The CLI is provided from this repository here. Now, there are multiple ways to install the CLI, depending on which OS you are using. I will provide information for:
- Ubuntu 20.04
- Ubuntu 22.04
While you may have never installed OneDrive before on your linux machine, it is best to run this as a precaution
If you are an undergraduate, ignore this step!
sudo apt remove onedrive
sudo add-apt-repository --remove ppa:yann1ck/onedrive
Save the following code as a script, and then run it in 'root' by using sudo su
If you are an undergraduate, ignore this step!
#!/bin/bash
rm -rf /var/lib/dpkg/lock-frontend
rm -rf /var/lib/dpkg/lock
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get autoremove -y
apt-get autoclean -y
Then:
reboot
To determine which instructions to follow, determine your OS:
lsb_release -a
alex@ubuntu-system:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/Release.key | sudo apt-key add -
echo 'deb https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/ ./' | sudo tee /etc/apt/sources.list.d/onedrive.list
sudo apt-get update
sudo apt install onedrive
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_22.04/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list
sudo apt-get update
sudo apt install onedrive
This will provide the GUI for OneDrive on Linux - It provides multi-account support.
sudo apt install libfuse2
cd ~/Documents
wget https://github.com/bpozdena/OneDriveGUI/releases/download/v1.0.3/OneDriveGUI-1.0.3_fix116-x86_64.AppImage
chmod +x ./OneDriveGUI-1.0.3_fix116-x86_64.AppImage
You will need to run the OneDriveGUI AppImage - this can be either done by double clicking the icon or right clicking the icon and selecting run
.
-
You will be met with the 'OneDriveGUID Setup Wizard'
Select: 'Create new OneDrive profile'
-
You will then to fill in your details and then click 'Create new profile':
Press 'Next'
-
You will be presenting with a OneDrive login request.
Click the link in the
1)
step. This will open a browser asking you to login.Once logged in, you will get a 'Permissions requested' prompt. Click
Accept
.You will then be presented with a blank screen. You will need to copy the URL!
Paste the URL in the OneDrive login profile screen from point 3. Then click
Login
.
You are now all set!
Microsoft Office apps cannot be natively installed on Linux. There are only two solutions to this problem.
-
The first solution is to use an electron wrapped Office 365 application. This means it you are still technically interfacing with the online Word/Powerpoint etc. applications.
-
The second solution is tediuous but is arguably better. This requires the installation of a Virtual Windows Machine and then running Office 365 in the VM. This will be the full Office 365 experience as if you had a windows machine.
Solution adapted from here
The current applications supported are:
Microsoft Excel 365 | Microsoft OneNote 365 | ||
Microsoft Outlook 365 | Microsoft PowerPoint 365 | ||
Microsoft Project 365 | Microsoft Word 365 |
sudo apt install zenity imagemagick
Then once those are installed...
cd ~/Documents
curl -s https://raw.githubusercontent.com/adil192/loffice-365/main/installer.sh | bash -s
This is a much more involved solution. The solution is adapted from here
sudo apt-get install -y virt-manager
You will need to download Windows Pro 10 and the KVM VirtIO drivers to allow for best performance.
Windows 10 ISO: https://www.microsoft.com/en-us/software-download/windows10ISO
KVM VirtIO drivers (for all distros): https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
The following guide will take you through the setup
To set up the standard way, open virt-manager
(Virtual Machines).
Next, go to Edit
->Preferences
, and check Enable XML editing
, then click the Close
button.
Now it is time to add a new VM by clicking the +
button.
Choose Local install media
and click Forward
.
Now select the location of your Windows 10 ISO, and Automatically detect
the installation.
Set your memory and CPUs. We recommend 2
CPUs and 4096MB
for memory. We will be using a Memory Ballooning service, meaning 4096 is the maximum amount of memory the VM will ever use, but will not use this amount except when it is needed.
Choose your virtual disk size, keep in mind this is the maximum size the disk will grow to, but it will not take up this space until it needs it.
Next, name your machine RDPWindows
so that WinApps can detect it, and choose to Customize configuration before install
.
After clicking Finish
, ensure under CPU that Copy host CPU configuration
is selected, and Apply
.
NOTE: Sometimes this gets turned off after Windows is installed. You should check this option after install as well.
Next, go to the XML
tab, and edit the <clock>
section to contain:
<clock offset='localtime'>
<timer name='hpet' present='yes'/>
<timer name='hypervclock' present='yes'/>
</clock>
Then Apply
. This will drastically reduce idle CPU usage (from ~25% to ~3%).
Next, under Memory, lower the Current allocation
to the minimum memory the VM should use. We recommend 1024MB
.
Under Boot options
, check Start virtual machine on host boot up
.
For SATA Disk 1, set the Disk bus
to VirtIO
.
For the NIC, set the Device model
to virtio
.
Click the Add Hardware
button in the lower right, and choose Storage
. For Device type
, select CDROM device
and choose the VirtIO driver ISO you downloaded earlier. This will give the Windows 10 Installer access to drivers during the install process. Now click Finish
to add the new CDROM device.
You are now ready to click Begin Installation
Now move on to installing the virtual machine.
From here out you will install Windows 10 Professional as you would on any other machine.
Once you get to the point of selecting the location for installation, you will see there are no disks available. This is because we need to load the VirtIO driver. Select Load driver
.
The installer will then ask you to specify where the driver is located. Select the E:\
drive or whichever drive the VirtIO driver ISO is located on.
Choose the appropriate driver for the OS you have selected, which is most likely the w10
driver for Windows 10.
You will now see a disk you can select for the installation.
Windows will begin to install, and you will likely need to reboot the VM a number times during this process.
Note: Remember to set a password for the user. If you don't set a password, you won't be able to connect via RDP later. If you forgot to set a password during the installation step, you can still set a password from Windows once the installation is complete.
At some point, you will come to a network screen. This is because the VirtIO drivers for the network have not yet been loaded. Simply click I don't have internet
.
It will confirm your choice, so just choose Continue with limited setup
.
After you get into Windows and login with the user you created during the install. Open up Explorer
and navigate the E:\
drive or wherever the VirtIO driver ISO is mounted. Double click the virt-win-gt-64.exe
file to launch the VirtIO driver installer.
Leave everything as default and click Next
through the installer. This will install device drivers as well as the Memory Ballooning service.
Once you finish the driver install, you will need to make some registry changes to enable RDP Applications to run on the system. Start by downloading the RDPApps.reg
file from the WinApps repo by visiting https://github.com/Fmstrat/winapps/blob/main/install/RDPApps.reg, right clicking on the Raw
button, and clicking on Save target as
.
Once you have downloaded the registry file, right click on it, and choose Merge
, then accept any confirmations along the way.
Next up, we need to rename the VM so that WinApps can locate it. Go to the start menu and type About
to bring up the About your PC
settings.
Scroll down and click on Rename this PC
Rename to RDPWindows
, and then Next
, but do not restart.
Lastly, scroll down to Remote Desktop
, and toggle Enable Remote Desktop
on, and Confirm
.
At this point you will need to restart and you have completed your setup.
You may also wish to install the Spice Guest Tools inside the VM which enables features like auto-desktop resize and cut-and-paste when using virt-manager
. As WinApps uses RDP, this is not necessary if you do not plan to access the machine via virt-manager
.
Once you are finished, restart the VM, but do not log in. Simply close the VM viewer, and close the Virtual Machine Manager.
You will need to start your VM of Windows
Once it has started, you will then need to open it (Click 'Open')
Download the image of MS Office365 here in your Virtual Windows Machine!
Once the download has completed, click on the O365ProPlusRetail.img
file. This will mount the drive. Then double Setup
to begin installing.
Then, open an application like Word
or Excel
. This will prompt you with a 'Product Key'. Click the prompt that says you do not have a product key. It will then prompt you to sign in on your Microsoft Account.
COMPLETE.
Tip: If for some reason you need to activate your Windows - Click this link