casualsnek / cassowary

Run Windows Applications on Linux as if they are native, Use linux applications to launch files files located in windows vm without needing to install applications on vm. With easy to use configuration GUI
GNU General Public License v2.0
2.94k stars 79 forks source link

libvirt_leaseshelper path and more #25

Open Somnius opened 2 years ago

Somnius commented 2 years ago

Cassowary needs to be tested on other distro's like PopOS ubuntu based.. i'm now in the process of installing arch on a spare laptop to be able to test if it works as expected then port the problems step-by-step to my home lab machine.

Paths like /usr/libexec/libvirt_leaseshelper and some pip3 issues at start.. will try to note the changes down and help, but still i'm new, that could be solved easier if the OP just test it on another distro and help us out!

Hope for your understanding. Kind regards -Som

casualsnek commented 2 years ago

I will start testing it on ubuntu based os for possible problems :) By the way if you can share the exact error messages you get, it will be easier for me to try to reproduce them and work on fixing them ! :)

Somnius commented 2 years ago

I'll start the process from scratch and report back, step-by-step.

Thank you for the prompt reply!

Somnius commented 2 years ago

So about my reporting back, this is part 1 of (we will soon know)

Currently using

image

I had virt-manager installed from Quickgui, the flutter frontend for quickget and quickemu for vm's.

Preped the files and folders including the latest ISO from the url you provided

image

On step 1 here https://github.com/casualsnek/cassowary/blob/main/docs/1-virt-manager.md the "Making KVM run without root access" my virt-manager runs on user with proper privs as shown here (excuse my zsh shell :P )

image

and successfully added the usr.sbin.libvirtd on the /etc/apparmor.d/disable/

after that on the next step where you say "Making network available with AppArmor enabled" i don't have the dnsmasq file in /etc/apparmor.d/ as shown here...

image

So first thing that stopped me was here, let's say we ignore it and go further..

Somnius commented 2 years ago

part 2..

Obviously had no problems creating the libvirt.conf file at ~/.config/libvirt/libvirt.conf, the command also helped without manually "touch" it.

At the Creating a Virtual Machine you can fix the images to be shown so the user won't have to switch back on links that open in the same window/tab.. ( :P ), enabled the xml without a problem but you say

"On top left of virt-manager click the "+" icon" that the virt-manager on PopOS has icons like this image so i suggest to change the guide to use the menu as File -> New Virtual Machine (just a suggestion)

After that on the Goto XML tab of CPU and replace the section why replace everything and not just edit the lines, cause in my example the xml includes the following

 <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>

That i could just change the hpet value to yes also the xml file on my virt-manager uses " instead of ' so a direct copy from your guide it may result in error when the xml configuration is parsed thru the virt-manager.. also if i leave the rtc and pit values intact will it affect the vm in any way?!?

At the part that you are inside the installation and no drives are found the "[...]will get no drives to install Windows 10[...]" you should suggest to search inside the amd64 folder of the second cd-rom cause when the user only selected the drive, it doesn't find anything that it can use..

image

it may seam all Greek to you, its cause it is Greek :P hahhaha

Just a note, it is going well so far, but i know i have a long way to go.. now go for part 3...

Somnius commented 2 years ago

this is part 3,

all well until now, but spice tools exe needs to be typed by hand in order to download it, no harm in that

at the part you say "Show virtual hardware button" you could also say from the Menu click "View" and then "Details" again for those that don't have the same icon color scheme or even the bar is hidden.

After the whole step 1 and spice installed i still don't have proper clipboard sharing, i should check this later..

Now switching to 2. Installing cassowary on Windows 10 and Linux

After the setup.bat and logging out, i re-login, but i find my self accepting 2 command prompt requests, maybe change the UAC to accept all changes ?! (suggestion, but quite non-secure)

For the Linux part on the On Linux page, you need to remove the $ from each command cause people can't just copy the "code" properly ;-) and for ubuntu-based we have the following

sudo apt install python3 python3-pip it's python3-pip instead of python-pip, but, there is a but yes... "freerdp" isn't available as a straight-install kind of package.. and i got the following error..

image

so the package we need to install is freerdp2-x11 with the following command..

sudo apt install freerdp2-x11

after running the next command and we stop at installing the actual cassowary with pip install cassowary-* command in PopUS ubuntu-based it is installed on a path outside the "PATH" with the following message :

image

so i edited the ~/.profile with nano like in the following screenshot to see that it is included but with a $HOME variable, but we can just add it to be on the safe side of things, no harm done..

image

("lef" is my username, change it with yours)

The window needs to inherit some characteristics of screen dpi cause when it's open it doesn't display correctly.

image

and maybe even have a pre-defined window width so all is displayed, also include a window/app name for the app bar cause image it is displayed as main py

Finally, managed to configure the desktop-* name, username + password and added e.g. Ms Edge as shortcut on my gnome applications.

Selected it, and nothing happens, please note that in virt-manager the vm is still running..

Now what?

casualsnek commented 2 years ago

what happens when you run python3 -m cassowary -c guest-run -- explorer.exe from terminal, can you share the output ?

does scaling issue gets fixed when running QT_AUTO_SCREEN_SCALE_FACTOR=1 python3 -m cassowary -a ? What is your current screen resolution and scaling factor if it is enabled ?

For the app name in app bar, how did you launch gui through commandline or desktop launcher ?

Le0xFF commented 2 years ago

About the documentation: I'm the one who mainly wrote it, so let's see if I can improve it more! I use Void Linux so a lot of packages are different from other distros.


I don't have the dnsmasq file in /etc/apparmor.d/

About this I really don't know what to say. I checked the .deb content from Ubuntu 21.10 (as Pop!_OS should use the same repos? Correct me if I'm wrong) and in fact the dnsmasq profile is totally absent. I could put a direct link to the profile from the apparmor gitlab and let the user copy it by hand or if you have any other idea, I will listen!

 

You can fix the images to be shown so the user won't have to switch back on links that open in the same window/tab

My bad lol I had some problems displaying them correctly, so I'll try to fix this with a PR!

 

I suggest to change the guide to use the menu as File -> New Virtual Machine

Definitely better.

 

[XML] why replace everything and not just edit the lines

To be honest, that edit is taken directly from WinApps repo's guide so I really don't know what would change if you just edit those lines instead of replacing them. I'm not a tech savvy about virt-manager.
You can always try it and report a feedback!

 

the xml file on my virt-manager uses " instead of '

My bad again I'll fix it. I really didn't noticed that, also I think virt-manager automatically correct that, as I never had any issue copying those lines.

 

you should suggest to search inside the amd64 folder

I'll add that as well, that didn't ever happen to me! I never had to search for that specific folder, as all the drivers were always be loaded.

 

you could also say from the Menu click "View" and then "Details"

Better for sure!

 

"freerdp" isn't available as a straight-install kind of package

I forgot a "2", sorry about that!

 

it is installed on a path outside the "PATH"

I'll add a warning about that too, but in the first part of the image you attached, your $HOME/.local/bin should be already added to your $PATH.


I made mostly all the changes you suggested and you can check them on my cassowary fork! Feel free to give any feedback before I make a PR!

Somnius commented 2 years ago

hey hi @Le0xFF about the freerdp package it is freerdp2-x11 not just freerdp2

I'm gonna check your repo soon, but i need to revert back at least the basics, also need to check the cassowary py script to see if it can run with flags that are needed for more dpi as @casualsnek mentioned in previous reply.

Will report back as soon as possible.

Somnius commented 2 years ago

@casualsnek i report with screenshot and code what you asked at first, can't check the second, i need to go (gmt+2)

image


┌─(~/Downloads/ISO/cassowary)──────────────────────────────(lef@pop-os:pts/0)─┐
└─(21:30:32)──> python3 -m cassowary -c guest-run -- explorer.exe
['explorer.exe']
[ 2022-02-06 21:30:53,532 ] | [  DEBUG ] :  [      helper ->              vm_wake  ] -->  Attempting to resume VM 
[ 2022-02-06 21:30:53,534 ] | [ WARNING ] :  [      helper ->              vm_wake  ] -->  VM state is not set to suspended : State -> '1'  
[ 2022-02-06 21:30:53,534 ] | [  DEBUG ] :  [      helper ->     fix_black_window  ] -->  An app was already opened, the black window should not appear now ! 
[ 2022-02-06 21:30:53,534 ] | [  DEBUG ] :  [    __init__ ->                 main  ] -->  guest-run with commandline: xfreerdp /d:"DESKTOP-RNS6FGN" /u:"user" /p:"123456" /v:192.168.122.229 +clipboard /a:drive,root,/ +decorations /cert-ignore /audio-mode:1 /scale:100 /dynamic-resolution /span  /wm-class:"cassowaryApp-explorer.exe" /app:"explorer.exe" /app-icon:"/home/lef/.local/lib/python3.9/site-packages/cassowary/base/../gui/extrares/cassowary_app.png"  
[21:30:53:883] [41446:41447] [INFO][com.freerdp.core] - freerdp_connect:freerdp_set_last_error_ex resetting error state
[21:30:53:884] [41446:41447] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[21:30:53:884] [41446:41447] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
[21:30:53:884] [41446:41447] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[21:30:53:884] [41446:41447] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rail
[21:30:53:884] [41446:41447] [INFO][com.freerdp.client.common.cmdline] - loading channelEx drdynvc
[21:30:53:191] [41446:41447] [INFO][com.freerdp.primitives] - primitives autodetect, using optimized
[21:30:53:232] [41446:41447] [INFO][com.freerdp.core] - freerdp_tcp_is_hostname_resolvable:freerdp_set_last_error_ex resetting error state
[21:30:53:232] [41446:41447] [INFO][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex resetting error state
[21:31:08:247] [41446:41447] [ERROR][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex ERRCONNECT_CONNECT_FAILED [0x00020006]
[21:31:08:247] [41446:41447] [ERROR][com.freerdp.core] - failed to connect to 192.168.122.229
Le0xFF commented 2 years ago

it is freerdp2-x11 not just freerdp2

It is freerdp2-x11 on Ubuntu (and I guess Debian) based distro but for example on Void Linux and on Arch Linux is just freerdp.
So I guess it's better to just keep freerdp2 in the guide to have a generic name to refer to.

casualsnek commented 2 years ago

Looks like RDP is failing, have you enabled RDP properly in VM ?

gusbemacbe commented 10 months ago

@Somnius

Where did you get /etc/apparmor.d/usr.sbin.libvirtd?

@casualsnek, I do not have this file. I use Endeavour OS, derived from Arch Linux.

Somnius commented 10 months ago

@Somnius

Where did you get /etc/apparmor.d/usr.sbin.libvirtd?

@casualsnek, I do not have this file. I use Endeavour OS, derived from Arch Linux.

It was 2y ago mate, I just can't recall now out of the top of my head, I'm sorry 😐😥