Fmstrat / winapps

Run Windows apps such as Microsoft Office/Adobe in Linux (Ubuntu/Fedora) and GNOME/KDE as if they were a part of the native OS, including Nautilus integration.
8.44k stars 404 forks source link

bin/winapps check OK, but ./installer.sh NOT OK #289

Open T0MuX opened 2 years ago

T0MuX commented 2 years ago

Hi, I don't understand why but bin/winapps check is fully OK (login OK, I see the entire Windows desktop trough xfreerdp), but when I run ./installer.sh it ends saying this :

[t0mux@tag-bureau winapps]$ ./installer.sh --user
Removing any old configurations...
Installing...
  Checking for installed apps in RDP machine (this may take a while)... Finished.

The RDP connection failed to connect or run. Please confirm FreeRDP can connect with:
  bin/winapps check

If it cannot connect, this is most likely due to:
  - You need to accept the security cert the first time you connect (with 'check')
  - Not enabling RDP in the Windows VM
  - Not being able to connect to the IP of the VM
  - Incorrect user credentials in winapps.conf
  - Not merging install/RDPApps.reg into the VM

Everything seems OK and well configured, but still doesn't work. I even renamed my virtual machine 'RDPWindows' and set the Windows hostname to 'RDPWindows', no change. Here is my .config/winapps/winapps.conf :

RDP_USER="administrator"
RDP_PASS="MyPassword"
RDP_IP="192.168.122.65"
RDP_FLAGS="/cert-ignore"
MULTIMON="false"

I already merged RDPApps.reg, and even checked if the keys are set in the registry, it's okay.

I also tried a manual start with bin/winapps manual "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" and it works partially... it's weird : xfreerdp shows up and login, I see the desktop, but nothing more is happening ! Outlook doesn't start ! (But it does if I just double click on OUTLOOK.EXE)

fbartels commented 2 years ago

What version of Windows are you trying to connect to? Its weird already that the full desktop comes up on the check argument, as this normally only opens the windows explorer.

T0MuX commented 2 years ago

Hi, I'm using Windows 10

fbartels commented 2 years ago

Windows 10 Home?

T0MuX commented 2 years ago

Hi, I'm using Windows 10 Pro 20H2 19042.985

lgonzalezsa commented 2 years ago

Same issue here with Windows 10 Pro 20H2. Could be possible to increase the logging info on the DEBUG flag to know what could be the problem?

lutzseverino commented 2 years ago

Run echo $LIBVIRT_DEFAULT_URI and share the output.

If nothing is printed to the console, edit your environment variables (/etc/enviroment or /etc/enviromental depending on the distribution, any search engine is your friend) and add this line: LIBVIRT_DEFAULT_URI=qemu:///system

lgonzalezsa commented 2 years ago

Seems is the expected output:

(conda_dev) gonluisr@gonluisr-HP-ZBook-15-G3:~/github/winapps$ echo $LIBVIRT_DEFAULT_URI
qemu:///system

In addition, the log file when DEBUG is true:

conda_dev) gonluisr@gonluisr-HP-ZBook-15-G3:~/github/winapps$ cat ~/.local/share/winapps/winapps.log
[mié  3 nov 09:57:44 CST 2021-27699] START
[mié  3 nov 09:57:44 CST 2021-27699] 1:install
[mié  3 nov 09:57:44 CST 2021-27699] 2:
[mié  3 nov 09:57:44 CST 2021-27699] @:install
[mié  3 nov 09:57:44 CST 2021-27699] END

As side note, am using the FQDN of the VM, for external reasons I cannot change the hostname to RDPWindows.

Something else we could check?

lgonzalezsa commented 2 years ago

Was doing some testing and I think the installer.sh get stuck on line 44, I was increasing the counter to 35 thinking was not enough time to complete, but no clue. https://github.com/Fmstrat/winapps/blob/7689ab8aa168a8d2b2d5ca75e8d26fb173760e72/installer.sh#L44

MichelBaie commented 2 years ago

Can you login through a normal rdp client ? Have you run the .reg file as written in the documentation ? I haven't put ignore-cert arguments, first time it asked me to trust definitively

dbouras commented 2 years ago

Most probably your version of freerdp (just like mine) does not pass /app-cmd: correctly. The hostname is not a problem - defining the IP address in winapps.conf is enough.

You can try the following and see if the "dir" command is executed in cmd after it's started:

(. ~/.config/winapps/winapps.conf; xfreerdp ${RDP_FLAGS} /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:"${RDP_IP}" /scale:"${RDP_SCALE}" /dynamic-resolution /span /app:'%windir%\system32\cmd.exe' /app-cmd:dir)

If not, then your version of freerdp has this problem. I have managed to patch installer.sh in order to install properly even with this issue. You can do the same by editing the following line in ~/.local/bin/winapps as shown in the following diff:

***************
*** 41,47 ****
        done;
        echo "powershell.exe -ExecutionPolicy Bypass -File \\\\tsclient\\home\\.local\\share\\winapps\\ExtractPrograms.ps1 > \\\\tsclient\home\\.local\\share\\winapps\\detected" >> ${HOME}/.local/share/winapps/installed.bat
        echo "RENAME \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp installed" >> ${HOME}/.local/share/winapps/installed.bat
!       xfreerdp /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +home-drive -wallpaper /span /wm-class:"RDPInstaller" /app:"C:\Windows\System32\cmd.exe" /app-icon:"${DIR}/../icons/windows.svg" /app-cmd:"/C \\\\tsclient\\home\\.local\\share\\winapps\\installed.bat" 1> /dev/null 2>&1 &
        COUNT=0
        while [ ! -f "${HOME}/.local/share/winapps/installed" ]; do
            sleep 5
--- 42,48 ----
        done;
        echo "powershell.exe -ExecutionPolicy Bypass -File \\\\tsclient\\home\\.local\\share\\winapps\\ExtractPrograms.ps1 > \\\\tsclient\home\\.local\\share\\winapps\\detected" >> ${HOME}/.local/share/winapps/installed.bat
        echo "RENAME \\\\tsclient\\home\\.local\\share\\winapps\\installed.tmp installed" >> ${HOME}/.local/share/winapps/installed.bat
!       xfreerdp /d:"${RDP_DOMAIN}" /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +home-drive -wallpaper /span /wm-class:"RDPInstaller" /app-icon:"${DIR}/../icons/windows.svg" /app:"\\\\tsclient\\home\\.local\\share\\winapps\\installed.bat" 1> /dev/null 2>&1 &
        COUNT=0
        while [ ! -f "${HOME}/.local/share/winapps/installed" ]; do
            sleep 5

This problem also prevents passing the file name when e.g. trying to open a Word document from the Linux desktop. I can live with this for the moment because you can simply start the Windows explorer, use it to navigate to wherever you need and open whatever file using the corresponding Windows application.

I've also made a few more changes as follows:

These are the switches I use in winapps.conf: RDP_FLAGS="+home-drive +fonts +clipboard +auto-reconnect +aero"

My full context diff is attached here for anyone interested. DIFF_20211202.txt