Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virsh start RDPWindows fails #213

Open
TheHighGroundWins opened this issue Apr 16, 2021 · 59 comments
Open

virsh start RDPWindows fails #213

TheHighGroundWins opened this issue Apr 16, 2021 · 59 comments

Comments

@TheHighGroundWins
Copy link

$virsh start RDPWindows
error: Failed to start domain 'RDPWindows'
error: Network not found: no network with matching name 'default'

@goddard-guryon
Copy link

Same thing happened with me, you need to start the network 'default' via systemctl (forgot the exact name of the service, try starting the VM from the virt-manager GUI, it should give a clue about that).

@TheHighGroundWins
Copy link
Author

@goddard-guryon
doing $sudo systemctl start libvirtd has allowed the virt-manager to finally open but.
Where should I look for the name of the service. I look around at the details of the virtual machine and in its name seems to be default.

Can you give me more clues to where I can find this mysterious service

@goddard-guryon
Copy link

goddard-guryon commented Apr 27, 2021

@goddard-guryon
doing $sudo systemctl start libvirtd has allowed the virt-manager to finally open but.
Where should I look for the name of the service. I look around at the details of the virtual machine and in its name seems to be default.

Can you give me more clues to where I can find this mysterious service

Finally found it after scouring through my search history ;) This is what worked for me, give it a try and lemme know if it works for you too

Edit: in case the link breaks or you don't want to open it, here's the codes:

virsh net-autostart default

If it says "failed to get network 'default'" (and virsh net-list --all gives empty list), try this:

virsh net-define /usr/share/libvirt/networks/default.xml
virsh net-autostart default
virsh net-start default

(also try running the commands with sudo and/or rebooting in case it's still not working)

@TheHighGroundWins
Copy link
Author

@goddard-guryon
thank you so much. however I have this strange problem were /usr/share/libvirt/ does not have networks even though I do have it installed.

was there any configuration that I was supposed to do that I am not aware of?

@goddard-guryon
Copy link

@TheHighGroundWins I'm not really sure what the error is then (coz I'm not a dev of this project :P) Do you have libvirtd service enabled? (in your previous comment you said you "started" libvirtd, but if you haven't "enabled" it, it will be inactive after every reboot; idk I'm just looking for possible mistakes here).

@TheHighGroundWins
Copy link
Author

@goddard-guryon enabling it helped but now I'm back at where I started but with a new error
$sudo virsh start RDPWindows
Results in failed to start domain
Cannot access storage file /mnt/W0S/Qemu/RDPWindows.raw no such file or directory

If I do the same command without sudo I just get default is not active.

For some reason I can't activate default with sudo

@goddard-guryon
Copy link

Well that seems strange. Check if there's any file in /etc/libvirt/storage. If not create a file there named "default.xml" and add these lines to it (pasting it from the file I have):

<network>
    <name>default</name>
    <forward mode='nat'>
        <nat>
            <port start='1024' end='65535' />
        </nat>
    </forward>
    <bridge name='virbr0' stp='on' delay='0' />
    <ip address='192.168.122.1' netmask='255.255.255.0'>
        <dhcp>
            <range start='192.168.122.2' end='192.168.122.254' />
        </dhcp>
    </ip>
</network>

Then try virsh net-create default.xml (and verify by net-list), and then the same net-autostart and net-start (reboot if needed).
Also, don't run virsh with sudo (I'm guessing that you installed RDPWindows as normal user, in that case sudo virsh can't detect that VM or any config you've made).

@TheHighGroundWins
Copy link
Author

@goddard-guryon I still have the same problem.
when I tried to run $virsh net-start default I keep getting:

error: Failed to start network default
error: internal error: Network is already in use by interface virbr0

only way to fix this is by using sudo which you told me not to do.

$virsh net-create default.xml results in :

error: Failed to create network from default.xml
error: internal error: Network is already in use by interface virbr0

if I can just start default without sudo then I think the rest of the problems will fix themselves.

also thank you from spending your time helping me.

@goddard-guryon
Copy link

Asa far as I know, virbr0 is what KVM is supposed to use for the network, and if that interface is already in use, there should be a profile present that it is using (are you sure virst net-list and sudo virsh net-list give empty lists?) The only reason I tell not to use sudo is because virsh will not be able to detect RDPWindows in sudo. But if creating the default network with sudo can work, then we can fix it. At this point I'm also not sure how to fix this (maybe try to stop libvirtd, create the xml, then start libvirtd back). If that doesn't work, I'd suggest you reinstall QEMU/KVM via the tutorial given (and after you have created the VM, do the net-autostart command before restarting linux).

@TheHighGroundWins
Copy link
Author

@goddard-guryon sudo virsh net-list returns fine. I think that I am lacking some kind of permission which is strange since I am in both libvirt and kvm groups.

I am trying to do this on arch maybe that is why this is not working.
at the end I either get some obscure error from using sudo virsh start RDPWindows which you told me I wasn't supposed to do or I get that the default network default is not active even though default is every much active and autostarted in sudo virsh net-list

@goddard-guryon
Copy link

goddard-guryon commented Apr 28, 2021

You're on Arch? Check this out and tell me if it works XD

If it's the same issue in your case, then just doing what's written in that comment should let you start RDPWindows without sudo

@TheHighGroundWins
Copy link
Author

@goddard-guryon I can finally run the commands without sudo however strangely enough I got the same error when I had tried to run sudo virsh start RDPWindows
when I run virsh start RDPWindows
I get

error: Failed to start domain 'RDPWindows'
error: Cannot access storage file '/mnt/WOS/Qemu/RDPWindow.raw': No such file or directory

@TheHighGroundWins
Copy link
Author

@goddard-guryon
your right in the XML file there is the directory with the /mnt
now I just need to find the location of the RDWindow.raw if it even exists that is.

@goddard-guryon
Copy link

(previous comment was wrong, I probably misunderstood the problem here, sorry in case you were following it) I honestly don't have much idea about the issue here, can you share the RDPWindows.xml file? My best bet is that you need to reinstall the VM at this point :(

@TheHighGroundWins
Copy link
Author

<domain type="kvm">
  <name>RDPWindows</name>
  <uuid>410b7343-7ab9-4b36-9fb4-56de354121fe</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/8.1"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">1544192</memory>
  <currentMemory unit="KiB">1544192</currentMemory>
  <vcpu placement="static">3</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-5.1">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="custom" match="exact" check="full">
    <model fallback="forbid">Haswell-noTSX-IBRS</model>
    <vendor>Intel</vendor>
    <feature policy="require" name="vme"/>
    <feature policy="require" name="ss"/>
    <feature policy="require" name="vmx"/>
    <feature policy="require" name="f16c"/>
    <feature policy="require" name="rdrand"/>
    <feature policy="require" name="hypervisor"/>
    <feature policy="require" name="arat"/>
    <feature policy="require" name="tsc_adjust"/>
    <feature policy="require" name="umip"/>
    <feature policy="require" name="stibp"/>
    <feature policy="require" name="arch-capabilities"/>
    <feature policy="require" name="xsaveopt"/>
    <feature policy="require" name="pdpe1gb"/>
    <feature policy="require" name="abm"/>
    <feature policy="require" name="amd-ssbd"/>
    <feature policy="require" name="skip-l1dfl-vmentry"/>
  </cpu>
  <clock offset="localtime">
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw" cache="none" discard="unmap"/>
      <source file="/mnt/WOS/Qemu/RDPWindow.raw"/>
      <target dev="sdc" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>
    </disk>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <controller type="pci" index="0" model="pcie-root"/>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="1" port="0x10"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="2" port="0x11"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0x12"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0x13"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x15"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
    </controller>
    <controller type="pci" index="7" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <controller type="usb" index="0" model="ich9-ehci1">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x7"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci1">
      <master startport="0"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x0" multifunction="on"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci2">
      <master startport="2"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x1"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci3">
      <master startport="4"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x2"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:c9:22:2c"/>
      <source network="default"/>
      <model type="virtio"/>
      <link state="up"/>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    </interface>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes" listen="127.0.0.1">
      <listen type="address" address="127.0.0.1"/>
      <image compression="off"/>
    </graphics>
    <sound model="ich6">
      <address type="pci" domain="0x0000" bus="0x07" slot="0x01" function="0x0"/>
    </sound>
    <video>
      <model type="virtio" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="2"/>
    </redirdev>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="3"/>
    </redirdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
</domain>

@goddard-guryon
Copy link

Ah, I was right lol. Most likely you haven't mounted the target drive (/dev/sdc) yet, that's why virsh can't detect it. Just mount it at the exact mountpoint which you've specified (which should be /mnt/WOS) and it should work. You might want to automount it on startup if you're gonna use winapps frequently, in which case edit your /etc/fstab to add this entry (you can find many detailed tutorials for this).

Side note, I see you haven't enabled cpu hpet, is it just because you forgot to do it or any other reason? (it's useful to reduce your idle CPU usage). In case you didn't follow the KVM installation guide, make sure to check it now and edit the corresponding entries in the XML file.

@TheHighGroundWins
Copy link
Author

@goddard-guryon wait your supposed to install this on a seperate partition?

I feel like I missed way too many steps including the htep, even though I kept checking the README.

Is there any way to install this software without an extra partition, I only have an mbr computer and I have the max numbers of partitions allowed already filled due to dualboot and I don't have any external storage devices available for this usage.

Also thank you for sticking with me and not just giving me a link from a similar problem.

@goddard-guryon
Copy link

goddard-guryon commented May 1, 2021

No no you're not supposed to give it a whole partition, but you need to provide it some storage site (you can select it to be an empty folder within your existing partitions). If you check your XML file, it says for the RDPWindow.raw that it's target device is sdc, which makes it look like you selected /dev/sdc as the storage site while creating the VM (and you probably mounted your /dev/sdc as /mnt/WOS in your linux filesystem). I'm not sure if you can check the history of mountpoints, but maybe a simple fdisk -l (or gparted) can give you some clue.

So basically, at this point, you can:

  • either mount your /dev/sdc at /mnt/WOS (assuming that I read the XML data correctly), and automount it on every startup

  • or you can configure the VM and change the mountpoint (you can directly edit the XML file, but an easier method is to open virt-manager), open the VM (just open RDPWindows, don't start it) and:

    • go to configurations
    • delete this storage point (it should be named something like "VirtIO Disk1"; if not, just check all the storage points present in your config and delete the one whose source path is /mnt/WOS/Qemu/RDPWindow.raw)
    • go to Add Hardware -> Storage -> Select custom storage -> add a folder from bottom left (ideally, create a new folder so that your workspace remains organized) -> add a volume from the '+' button in volumes -> choose this volume and you're done. This should work without rebooting or anything

*nested bullets are tough :/

@Ilovemyhous
Copy link

Ilovemyhous commented May 3, 2021

Hello everyone!
I have the same issue as you. (See image)
image

And I use Garuda Linux (which is based on Arch, like Manjaro), but can someone please tell me in a nutshell how to solve it?
Thanks!

My network interfaces:
image

Note: My virbr1 connection is active.

@TheHighGroundWins
Copy link
Author

@goddard-guryon since I'm using arch, am I fine just installing the vm from the way the setting up VM guide told me to.
I followed the instructions on setting up a vm that you told me to look and and now virsh start RDPWindows works
or should I install from the arch xml file.

I'm sorry if I have wasted your time because I didn't see the kvm setup guide, I honestly didn't see it the first time

@Ilovemyhous
Copy link

@goddard-guryon since I'm using arch, am I fine just installing the vm from the way the setting up VM guide told me to.
I followed the instructions on setting up a vm that you told me to look and and now virsh start RDPWindows works
or should I install from the arch xml file.

I'm sorry if I have wasted your time because I didn't see the kvm setup guide, I honestly didn't see it the first time

What did you basically do to repair it? ^^'
Because I had issues trying to activate the virbr1.
Thank you!

@TheHighGroundWins
Copy link
Author

@Ilovemyhous what exactly is your problem?
For me the problem was that virbr0 was already using the network and so this one which was what @goddard-guryon sent me worked.
I don't now the difference between virbr0 and virbr1 maybe you are running the wrong one but I may be very wrong

@goddard-guryon
Copy link

@Ilovemyhous seems like your problem is also regarding running as normal user vs super user (I can't understand the error in the second command, but I'll assume that virsh can't find RDPWindows, you can verify it by running virsh list --all and sudo virsh list --all, if the sudo command shows RDPWindows while normal command shows nothing, then I'm correct 😛). If that is the case, create a file ~/.config/libvirt/libvirt.conf and add a single line in it: uri_default = qemu:///system, restart the libvirt service (systemctl restart libvirt.service) and it should work.

Regarding writing the whole list of steps one can take, I think I'll add that in the readme and put a pull request since I think winapps does work fine on Arch (although the readme doesn't say it).

@goddard-guryon
Copy link

@TheHighGroundWins if the bin/winapps check command works fine, then you're all good. I'm not sure what you mean by the "arch xml file", but the VM guide given is good enough to get it working. Also, it's not your fault (except the storage device you selected 😆), starting winapps on Arch does require a few additional steps as far as I can see.

@TheHighGroundWins
Copy link
Author

I am getting errors when I run /bin/winapps check but it all seems to be some problem with how I set windows remote desktop since I couldn't find the button to enable it so I just installed the windows remote app from the microsoft store.

As I get the error that err connect dns not found.

May be due to my version of windows. I'm using windows 10 pro.

@goddard-guryon
Copy link

The version of windows doesn't matter in this case. Just make sure you have enabled remote desktop, changed your PC name to RDPWindows and installed the registry file mentioned in the guide (and reboot if needed). If it doesn't work even after that, then post the error here or in another issue (if you open a different issue, make sure to mark this as closed), maybe I'll be able to help.

@Ilovemyhous
Copy link

@Ilovemyhous seems like your problem is also regarding running as normal user vs super user (I can't understand the error in the second command, but I'll assume that virsh can't find RDPWindows, you can verify it by running virsh list --all and sudo virsh list --all, if the sudo command shows RDPWindows while normal command shows nothing, then I'm correct stuck_out_tongue). If that is the case, create a file ~/.config/libvirt/libvirt.conf and add a single line in it: uri_default = qemu:///system, restart the libvirt service (systemctl restart libvirt.service) and it should work.

image
The first commands says: Error: Impossible to connect to the hypervisor.
Error: Syntax error in configuration file: /home/username/.config/libvirt/libvirt.conf : 1 : variable needed

@goddard-guryon
Copy link

@Ilovemyhous oh damn, my bad I didn't provide correct syntax. The line should be uri_default = "qemu:///system" (add " on either side of qemu:///system). Also, the service name would be libvirtd.service instead of libvirt.service

@Ilovemyhous
Copy link

Done, and still the same error on the third command. ^^'
image

@goddard-guryon
Copy link

Well that's strange, but I think I see the error. Have you added two " at the end of the line?

@goddard-guryon
Copy link

@Ilovemyhous glad to help :)

@soo-shan
Copy link

soo-shan commented Jul 3, 2021

I'm also facing similar issue.

user@suclear~/winapps (main) $ bin/winapps check
error: failed to get network 'default'
error: Network not found: no network with matching name 'default'
xfreerdp: error while loading shared libraries: libfreerdp-client2.so.2: cannot open shared object file: No such file or directory

The issue with my setup is that the network name is "network" instead of "default"

What can I do so that winapp checks for network instead of default?

@goddard-guryon
Copy link

goddard-guryon commented Jul 4, 2021

@soo-shan assuming that you've checked it using virsh net-list --all, you can either edit the RDPWindows.xml file and change the network name there from default to network, or you can use virsh net-edit network and change the name in the XML file from network to default (I'm not sure if the second option will work though since, as far as I know, there is always a default network present in network list. Have you checked using both virsh net-list --all and sudo virsh net-list --all?)

@soo-shan
Copy link

soo-shan commented Jul 4, 2021

@goddard-guryon My issue was not related to permission. Both commands give same output

 Name      State    Autostart   Persistent
--------------------------------------------
 network   active   yes         yes

I updated line 62 in winapps.sh to

RDP_IP=$(virsh net-dhcp-leases network |grep RDPWindows |awk '{print $5}')

and winapps was able to access the network.

But now m getting different error:

user@suclear~/winapps (main) $ bin/winapps check
[21:11:41:046] [2861:2862] [INFO][com.freerdp.core] - freerdp_connect:freerdp_set_last_error_ex resetting error state
[21:11:41:046] [2861:2862] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[21:11:41:046] [2861:2862] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
[21:11:41:046] [2861:2862] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[21:11:41:046] [2861:2862] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rail
[21:11:41:046] [2861:2862] [INFO][com.freerdp.client.common.cmdline] - loading channelEx drdynvc
[21:11:41:360] [2861:2862] [INFO][com.freerdp.primitives] - primitives autodetect, using optimized
[21:11:41:362] [2861:2862] [INFO][com.freerdp.core] - freerdp_tcp_is_hostname_resolvable:freerdp_set_last_error_ex resetting error state
[21:11:41:362] [2861:2862] [INFO][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex resetting error state
[21:11:41:372] [2861:2862] [WARN][com.freerdp.crypto] - Certificate verification failure 'self signed certificate (18)' at stack position 0
[21:11:41:372] [2861:2862] [WARN][com.freerdp.crypto] - CN = RDPWindows
[21:11:41:573] [2861:2862] [WARN][com.freerdp.core.nla] - SPNEGO received NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308] from server
[21:11:41:573] [2861:2862] [ERROR][com.freerdp.core.nla] - SPNEGO failed with NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308]
[21:11:41:573] [2861:2862] [ERROR][com.freerdp.core] - nla_recv_pdu:freerdp_set_last_error_ex ERRCONNECT_AUTHENTICATION_FAILED [0x00020009]
[21:11:41:573] [2861:2862] [ERROR][com.freerdp.core.rdp] - rdp_recv_callback: CONNECTION_STATE_NLA - nla_recv_pdu() fail
[21:11:41:573] [2861:2862] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1

Earlier I got certificate issue. I did Y for trusting the certificate

user@suclear~/winapps (main) $ bin/winapps check
[21:10:53:367] [2824:2825] [INFO][com.freerdp.core] - freerdp_connect:freerdp_set_last_error_ex resetting error state
[21:10:53:367] [2824:2825] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[21:10:53:367] [2824:2825] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
[21:10:53:367] [2824:2825] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[21:10:53:367] [2824:2825] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rail
[21:10:53:367] [2824:2825] [INFO][com.freerdp.client.common.cmdline] - loading channelEx drdynvc
[21:10:53:683] [2824:2825] [INFO][com.freerdp.primitives] - primitives autodetect, using optimized
[21:10:53:685] [2824:2825] [INFO][com.freerdp.core] - freerdp_tcp_is_hostname_resolvable:freerdp_set_last_error_ex resetting error state
[21:10:53:685] [2824:2825] [INFO][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex resetting error state
[21:10:55:561] [2824:2825] [INFO][com.freerdp.crypto] - creating directory /home/user/.config/freerdp
[21:10:55:562] [2824:2825] [INFO][com.freerdp.crypto] - creating directory [/home/user/.config/freerdp/certs]
[21:10:55:562] [2824:2825] [INFO][com.freerdp.crypto] - created directory [/home/user/.config/freerdp/server]
[21:10:55:574] [2824:2825] [WARN][com.freerdp.crypto] - Certificate verification failure 'self signed certificate (18)' at stack position 0
[21:10:55:574] [2824:2825] [WARN][com.freerdp.crypto] - CN = RDPWindows
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - @           WARNING: CERTIFICATE NAME MISMATCH!           @
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - The hostname used for this connection (192.168.100.214:3389) 
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - does not match the name given in the certificate:
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - Common Name (CN):
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - 	RDPWindows
[21:10:55:574] [2824:2825] [ERROR][com.freerdp.crypto] - A valid certificate for the wrong name should NOT be trusted!
Certificate details for 192.168.100.214:3389 (RDP-Server):
	Common Name: RDPWindows
	Subject:     CN = RDPWindows
	Issuer:      CN = RDPWindows
	Thumbprint:  6a:xx:8e:xx:3e:xx:72:xx:fc:xx:49:xx:6a:xx:2c:xx:40:xx:bf:xx:02:xx:25:xx:96:xx:65:xx:67:xx:0c:xx
The above X.509 certificate could not be verified, possibly because you do not have
the CA certificate in your certificate store, or the certificate has expired.
Please look at the OpenSSL documentation on how to add a private CA to the store.
Do you trust the above certificate? (Y/T/N) Y
[21:11:24:347] [2824:2825] [WARN][com.freerdp.core.nla] - SPNEGO received NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308] from server
[21:11:24:347] [2824:2825] [ERROR][com.freerdp.core.nla] - SPNEGO failed with NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308]
[21:11:24:347] [2824:2825] [ERROR][com.freerdp.core] - nla_recv_pdu:freerdp_set_last_error_ex ERRCONNECT_AUTHENTICATION_FAILED [0x00020009]
[21:11:24:347] [2824:2825] [ERROR][com.freerdp.core.rdp] - rdp_recv_callback: CONNECTION_STATE_NLA - nla_recv_pdu() fail
[21:11:24:347] [2824:2825] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1

I'm using Windows 10 Ameliorated.

@goddard-guryon
Copy link

@soo-shan ERRCONNECT_AUTHENTICATION_FAILED did you check the login credentials? This looks like incorrect credentials, everything else seems fine

@soo-shan
Copy link

soo-shan commented Jul 5, 2021

@goddard-guryon I rechecked my credentials. They are correct.
I tried RDP with remmina and I was able to connect to VM. So VM is accessible from outside.
Can I try anything else ?

@soo-shan
Copy link

soo-shan commented Jul 5, 2021

Tried
xfreerdp /v:192.168.100.214 /u:user

[22:17:42:314] [5198:5199] [INFO][com.freerdp.core] - freerdp_connect:freerdp_set_last_error_ex resetting error state
[22:17:42:314] [5198:5199] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[22:17:42:314] [5198:5199] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
[22:17:42:314] [5198:5199] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[22:17:43:628] [5198:5199] [INFO][com.freerdp.primitives] - primitives autodetect, using optimized
[22:17:43:631] [5198:5199] [INFO][com.freerdp.core] - freerdp_tcp_is_hostname_resolvable:freerdp_set_last_error_ex resetting error state
[22:17:43:631] [5198:5199] [INFO][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex resetting error state
[22:17:43:640] [5198:5199] [WARN][com.freerdp.crypto] - Certificate verification failure 'self signed certificate (18)' at stack position 0
[22:17:43:640] [5198:5199] [WARN][com.freerdp.crypto] - CN = RDPWindows
Password: 
[22:17:45:308] [5198:5199] [WARN][com.freerdp.core.nla] - SPNEGO received NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308] from server
[22:17:45:308] [5198:5199] [ERROR][com.freerdp.core.nla] - SPNEGO failed with NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308]
[22:17:45:308] [5198:5199] [ERROR][com.freerdp.core] - nla_recv_pdu:freerdp_set_last_error_ex ERRCONNECT_AUTHENTICATION_FAILED [0x00020009]
[22:17:45:308] [5198:5199] [ERROR][com.freerdp.core.rdp] - rdp_recv_callback: CONNECTION_STATE_NLA - nla_recv_pdu() fail
[22:17:45:308] [5198:5199] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1

Something related to freerdp is issue !!

xfreerdp --version
This is FreeRDP version 2.3.2 (n/a)

@goddard-guryon
Copy link

@soo-shan I tried to replicate the log you get, and got the exact same log only when the credentials were wrong. Make sure you're writing the correct username after /u: and correct password in the prompt. Also, have you logged in to your Microsoft account from within the VM? If that's the case, you'd need to enter your email ID in username and that ID's password in the password prompt.

@soo-shan
Copy link

soo-shan commented Jul 6, 2021

@goddard-guryon

xfreerdp /v:192.168.100.214 /u:user /p:malte
[15:41:15:776] [6235:6236] [INFO][com.freerdp.core] - freerdp_connect:freerdp_set_last_error_ex resetting error state
[15:41:15:776] [6235:6236] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpdr
[15:41:15:776] [6235:6236] [INFO][com.freerdp.client.common.cmdline] - loading channelEx rdpsnd
[15:41:15:776] [6235:6236] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[15:41:15:099] [6235:6236] [INFO][com.freerdp.primitives] - primitives autodetect, using optimized
[15:41:15:103] [6235:6236] [INFO][com.freerdp.core] - freerdp_tcp_is_hostname_resolvable:freerdp_set_last_error_ex resetting error state
[15:41:15:103] [6235:6236] [INFO][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex resetting error state
[15:41:15:128] [6235:6236] [WARN][com.freerdp.crypto] - Certificate verification failure 'self signed certificate (18)' at stack position 0
[15:41:15:129] [6235:6236] [WARN][com.freerdp.crypto] - CN = RDPWindows
[15:41:15:330] [6235:6236] [WARN][com.freerdp.core.nla] - SPNEGO received NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308] from server
[15:41:15:330] [6235:6236] [ERROR][com.freerdp.core.nla] - SPNEGO failed with NTSTATUS: SEC_E_INVALID_TOKEN [0x80090308]
[15:41:15:330] [6235:6236] [ERROR][com.freerdp.core] - nla_recv_pdu:freerdp_set_last_error_ex ERRCONNECT_AUTHENTICATION_FAILED [0x00020009]
[15:41:15:330] [6235:6236] [ERROR][com.freerdp.core.rdp] - rdp_recv_callback: CONNECTION_STATE_NLA - nla_recv_pdu() fail
[15:41:15:330] [6235:6236] [ERROR][com.freerdp.core.transport] - transport_check_fds: transport->ReceiveCallback() - -1

Tried with /p option. Same result

@soo-shan
Copy link

soo-shan commented Jul 6, 2021

@goddard-guryon
It was a problem with freerdp package in my distro (clear linux). I'm not very comfortable in compiling from sources so I built using flatpak ( from here )
Now I'm able to login to the VM using rdp.
Now need to somehow let winapps use xrdp from flatpak (flatpak run com.freerdp.FreeRDP) instead of default one. Any suggestions ?

@goddard-guryon
Copy link

Ah, yeah it must've been an issue with the install :/ about the flatpak though, I'm not really sure. But I'd guess if you can connect it to the VM, just setting xfreerdp as an alias to the flatpak command should be fine for winapps. But I'm not sure about it, so give it a try and lemme know if it works

@soo-shan
Copy link

soo-shan commented Jul 7, 2021

So this is getting more trickier than I anticipated.
The alias command did not work for changing the default for `xfreerdp' to flatpak version.
Looked around a bit and found a neat trick. Created a file xfreerdp under ~/bin with following content

#!/usr/bin/sh
flatpak run com.freerdp.FreeRDP 

and added bin to PATH in .bashrc

Now I was getting the version I want to use for xfreerdp.

Going ahead with instructions in README.md, tried step 4: bin/winapps check. It showed the output from xfreerdp. But didnt show any certificate popup. May be bcaz I tried earlier to access VM with 'xfreerdp' command and accepted certificate.
But I did not get any pop up for windows explorer.
I went ahead and executed
$ ./installer.sh

? Would you like to install for the current user or the whole system? User
Removing any old configurations...
grep: /home/user/.local/bin/*: No such file or directory
grep: /usr/local/bin/*: No such file or directory
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

checked with xfreerdp. Able to connect to VM
Only thing I can think from the list is registry changes in VM
Here are the screenshots. Does these changes looks fine?
Screenshot_2021-07-07_10-57-03
Screenshot_2021-07-07_10-50-40

@goddard-guryon
Copy link

@soo-shan the registry entries look fine, but I think winapps is having trouble working with xfreerdp. You said you didn't get the explorer window popup when using bin/winapps check, can you post the log of that command? It should give more detail about the error, since the installer log isn't verbose enough

@TheHighGroundWins
Copy link
Author

I'm sorry for being unavailable for quite some time. I got busy with school work since I was nearing graduating.

on a lighter note I got winapps to work.
How I did it was to create a virtual machine just as the guide in this github repo said and then change the name of the virtual machine to RDPWindows. I did not have any success with the xml files but this worked. I won't close this issue as many others seem to be having different problems that are preventing them from having $virsh start RDPWindows work

@soo-shan
Copy link

soo-shan commented Jul 9, 2021

@goddard-guryon Added some details below. These are the details I was able to find. If you want to take a look at some other details/logs you may have to guide me how to get them.
@TheHighGroundWins All the best for your future.

Logs from `~/.local/share/winapps/winapps.log' below

Wed 07 Jul 2021 10:35:55 AM IST-16117] START
1 [Wed 07 Jul 2021 10:35:55 AM IST-16117] 1:install
2 [Wed 07 Jul 2021 10:35:55 AM IST-16117] 2:
3 [Wed 07 Jul 2021 10:35:55 AM IST-16117] @:install
4 [Wed 07 Jul 2021 10:35:55 AM IST-16117] END
5 [Fri 09 Jul 2021 10:28:20 AM IST-6670] START
6 [Fri 09 Jul 2021 10:28:20 AM IST-6670] LAST_RAN:1625634355
7 [Fri 09 Jul 2021 10:28:20 AM IST-6670] THIS_RUN:1625806700
8 [Fri 09 Jul 2021 10:28:20 AM IST-6670] 1:check
9 [Fri 09 Jul 2021 10:28:20 AM IST-6670] 2:
10 [Fri 09 Jul 2021 10:28:20 AM IST-6670] @:check
11 [Fri 09 Jul 2021 10:28:20 AM IST-6670] CHECK
12 [Fri 09 Jul 2021 10:28:20 AM IST-6670] END
13 [Fri 09 Jul 2021 10:32:17 AM IST-3437] START
14 [Fri 09 Jul 2021 10:32:17 AM IST-3437] LAST_RAN:1625806700
15 [Fri 09 Jul 2021 10:32:17 AM IST-3437] THIS_RUN:1625806937
16 [Fri 09 Jul 2021 10:32:17 AM IST-3437] 1:check
17 [Fri 09 Jul 2021 10:32:17 AM IST-3437] 2:
18 [Fri 09 Jul 2021 10:32:17 AM IST-3437] @:check
19 [Fri 09 Jul 2021 10:32:17 AM IST-3437] CHECK
20 [Fri 09 Jul 2021 10:32:17 AM IST-3437] END

One strange thing I noticed was I turned off auto start at boot for the VM and when I issued command `bin/winapps check' it did not mention to start VM, unlike some ealier messages from thread.

FreeRDP version

X11 /app/bin/xfreerdp
This is FreeRDP version 3.0.0-dev (0ab809d)

Config File from ~/.config/winapps/winapps.conf

RDP_PASS="malte"
RDP_DOMAIN="RDPWINDOWS"
RDP_IP="192.168.100.214"
#RDP_SCALE=100
#RDP_FLAGS=""
#MULTIMON="true"
DEBUG="true"

OS Details
image

@goddard-guryon
Copy link

goddard-guryon commented Jul 10, 2021

@TheHighGroundWins all the best buddy :D
@soo-shan can you post the log you get from bin/winapps check command? Not the output, just whatever log gets printed out on terminal. The point that the command doesn't even notice that the VM is switched off makes me think that it's probably unable to connect to it. Maybe you'd need to compile the source files in that case :/

@soo-shan
Copy link

soo-shan commented Jul 10, 2021

@goddard-guryon
Its the generic output from xfreerdp
pastebin: link

Also I think you are correct. This issue is something related to xfreerdp version.

@soo-shan
Copy link

@goddard-guryon Finally I think I got xfreerdp configured correctly. Thank you for the hint.
I found the path for flatpak xfreerdp and passed arguments to xfreerdp command. This was a crucial missing piece bcaz of which only xfreerdp command was getting executed and any argument in winapps were getting ignored

For anyone looking for making a flatpak cli app the preferred one can use this trick. I updated the ~/bin/xfreerdp file to below

#!/usr/bin/sh
/var/lib/flatpak/exports/bin/com.freerdp.FreeRDP "$@"

Now while running bin/winapps check I'm getting the windows file explorer. Also my Downloads folder is also shared with windows. Really impressed by that and want to make further use of winapps.

But `./installer.sh' is showing following error

$ ./installer.sh 
? Would you like to install for the current user or the whole system? User
Removing any old configurations...
grep: /home/cloe/.local/bin/*: No such file or directory
grep: /usr/local/bin/*: No such file or directory
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

Any suggestions for debugging ?

@goddard-guryon
Copy link

@soo-shan oh yes I also realized it after seeing the pastebin file. When creating a shell file, there needs to be an explicit parameter to pass arguments :P
But now the installer script is just acting weird for no reason. The only thing(s) I can suggest is restarting the computer (lol), clearing cache and/or re-downloading the winapps data from github.

@soo-shan
Copy link

@goddard-guryon Tried restarting and reinstalling. Nothing works.
Though I can use bin/winapps manual "%office%\WINWORD.EXE" and updated app/word/info to point to correct installation location but bin/winapps word is not working. Also I can directly use `freerdp' if I have to use terminal only. So winapps is not much of use in that case.
Maybe some distribution specific issue is there.
Looking around more in code. Though not familiar with bash is making things little harder. Will update if I find anything.

@goddard-guryon
Copy link

goddard-guryon commented Jul 16, 2021

@soo-shan sorry I've been a bit busy with stuff so I haven't been able to help much. I really can't think of any clues about why this is happening, the most logical answer does seem to be a distro-specific issue though (maybe you're missing a few packages that winapps or its dependencies need). Even though it's for Arch, I'd say give this a try. If that doesn't work, you'll have to open a new issue to attract more helpers to it :(
Also, have you tried compiling source files for freerdp? I know you said it's too complicated, but if nothing else works, might as well give it a shot

@soo-shan
Copy link

@goddard-guryon not need for apology.
I'm already following below instruction:
Create a file ~/.config/libvirt/libvirt.confand add a single line in it:uri_default = "qemu:///system". This allows you to run the VM and winapps without using sudo`'

I'm not too familiar with githubs PR and commits. Is there something else that I missed from the link ?

@goddard-guryon
Copy link

@soo-shan this is the file that I've updated in the PR, you can just follow the instructions for Arch (they're in the bottom part of the file)

@soo-shan
Copy link

@goddard-guryon thank you for the link. I will try that sometime in future since clear linux packages apps in some other way, it will take time for me to find all the packages but for now I got the workaround. I can use check command and then open any app by clicking on its shortcut. Added all shortcuts on desktop for easy access.

@bphd
Copy link

bphd commented Nov 13, 2021

I'm sorry for being unavailable for quite some time. I got busy with school work since I was nearing graduating.

on a lighter note I got winapps to work. How I did it was to create a virtual machine just as the guide in this github repo said and then change the name of the virtual machine to RDPWindows. I did not have any success with the xml files but this worked. I won't close this issue as many others seem to be having different problems that are preventing them from having $virsh start RDPWindows work

Personally, I already have everything named accordingly, and I still have the [ERROR][com.freerdp.core] - freerdp_tcp_is_hostname_resolvable:freerdp_set_last_error_ex ERRCONNECT_DNS_NAME_NOT_FOUND [0x00020005] error

@gilberto-009199
Copy link

use
export LIBVIRT_DEFAULT_URI="qemu:///system"

@kotolinux
Copy link

This worked for me! Thank You!

76 sudo virsh net-list
77 mkdir -p ~/.config/libvirt
78 nano ~/.config/libvirt/libvirt.conf
79 cat ~/.config/libvirt/libvirt.conf
80 virsh start RDPWindows
81 virsh net-start
82 sudo systemctl start libvirtd
84 sudo apt-get install -y freerdp2-x11 virt-manager
85 git clone https://github.com/Fmstrat/winapps.git
86 mkdir -p ~/.config/winapps/
87 echo '''
RDP_USER="tutorial" #Replace with your vm username
RDP_PASS="tutorial" #Replace with your vm password
MULTIMON="true"
''' >> ~/.config/winapps/winapps.conf
88 ~/winapps/bin/winapps check
89 ~/winapps/installer.sh
90 virsh start RDPWindows
91 sudo virsh net-list --all
92 sudo virsh net-start RDPWindows

@IPlayZed
Copy link

I think this is also caused by user session created VMs, there is no default network there, but only usermode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants