sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
45.45k stars 2.41k forks source link

Mouse Stuck Issue Continues #218

Open bayramog opened 3 years ago

bayramog commented 3 years ago

The issue still continues if I give -e RAM=some number. But if I don't give any -e RAM value. There is no issue.

Originally posted by @bayramog in https://github.com/sickcodes/Docker-OSX/issues/207#issuecomment-803784955

sickcodes commented 3 years ago

Yes because I updated 2GB to 3GB

You cannot use all of your RAM, use a little bit less because the guest will use ALL of it 😂

bayramog commented 3 years ago

I have 16GB ram and I sent the command with -e RAM=10. Still mouse stucks.

sickcodes commented 3 years ago

Can you post the output of this:

# OS related issued, please help us identify the issue by posting the output of this
uname -a \
; echo "${DISPLAY}" \
; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs \
; grep NAME /etc/os-release \
; df -h . \
; qemu-system-x86_64 --version \
; libvirtd --version \
; free -mh \
; nproc \
; egrep -c '(svm|vmx)' /proc/cpuinfo \
; ls -lha /dev/kvm \
; ls -lha /tmp/.X11-unix/ \
; ps aux | grep dockerd \
; docker ps | grep osx \
; grep "docker\|kvm\|virt" /etc/group
bayramog commented 3 years ago

the output is at below.

1 NAME="Ubuntu" PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Filesystem Size Used Avail Use% Mounted on /dev/sdd 251G 4.1G 235G 2% / QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.14) Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 6.0.0 total used free shared buff/cache available Mem: 7.7Gi 624Mi 2.3Gi 400Mi 4.8Gi 6.4Gi Swap: 2.0Gi 0.0Ki 2.0Gi 8 8 crw-rw-rw- 1 root root 10, 232 Mar 25 17:13 /dev/kvm total 8.0K drwxr-xr-x 2 root root 4.0K Mar 25 17:24 . drwxrwxrwt 3 root root 4.0K Mar 25 17:24 .. ogulcan+ 1620 0.0 0.0 8160 728 pts/0 S+ 17:32 0:00 grep --color=auto dockerd kvm:x:108: libvirt:x:120:ogulcanbayram libvirt-qemu:x:64055:libvirt-qemu libvirt-dnsmasq:x:121: docker:x:1001:ogulcanbayram

sickcodes commented 3 years ago

This says you have Mem: 7.7Gi

bayramog commented 3 years ago

On WSL2 system limited my RAM so I remove the RAM limitation. New output is like this.

Linux DESKTOP-T1VS9UR 5.4.91-microsoft-standard-WSL2 #1 SMP Thu Mar 25 16:02:37 +03 2021 x86_64 x86_64 x86_64 GNU/Linux 172.20.64.1:0.0 1 NAME="Ubuntu" PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Filesystem Size Used Avail Use% Mounted on drvfsa 239G 87G 152G 37% /mnt/c QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.14) Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 6.0.0 total used free shared buff/cache available Mem: 15Gi 1.4Gi 11Gi 400Mi 2.9Gi 13Gi Swap: 4.0Gi 0B 4.0Gi 8 8 crw-rw-rw- 1 root root 10, 232 Mar 26 09:00 /dev/kvm total 8.0K drwxr-xr-x 2 root root 4.0K Mar 25 17:24 . drwxrwxrwt 3 root root 4.0K Mar 26 09:02 .. ogulcan+ 434 0.0 0.0 8160 664 pts/3 S+ 09:09 0:00 grep --color=auto dockerd 1d033e853d18 sickcodes/docker-osx:big-sur "/bin/bash -c 'sudo …" About a minute ago Up About a minute 0.0.0.0:50922->10022/tcp kind_bhaskara kvm:x:108: libvirt:x:120:ogulcanbayram libvirt-qemu:x:64055:libvirt-qemu libvirt-dnsmasq:x:121: docker:x:1001:ogulcanbayram

sickcodes commented 3 years ago

Now your mouse will not get stuck, did you try?

bayramog commented 3 years ago

Yes I tried and mouse still stucks.

sickcodes commented 3 years ago

Yes I tried and mouse still stucks.

Can you send me a video privately? info at sick codes

bayramog commented 3 years ago

Hello, I have sent an email that contains the video.

sickcodes commented 3 years ago

Yes I received the email I'm not sure how to approach it on windows but perhaps changing usb-tablet inside of qemu might solve it. Or is there a way you can choose mouse settings in Windows in relation to this hypervisor?

bayramog commented 3 years ago

I have tried OSX-KVM. with usb-tablet and same WSL2-Ubuntu setup, the VM works fine

sickcodes commented 3 years ago

I have tried OSX-KVM. with usb-tablet and same WSL2-Ubuntu setup, the VM works fine

Hmmmm

Can you paste the command you used with OSX-KVM That was successful?

I will see what the difference is and add a WINDOWS tag to make sure the dockerfile runs like it should on WSL2 :)

Thank you for testing that

jpmorrison commented 2 years ago

is there a fix? this seems like a quemu bug.

sickcodes commented 2 years ago

It's a low raw issue if it happens inside macOS, how much ram are you giving it?

Sorry, usb-tablet might be the issue/solution. I will organize a a WSL2 this week to test on

jpmorrison commented 2 years ago

It's a low raw issue if it happens inside macOS, how much ram are you giving it?

Sorry, usb-tablet might be the issue/solution. I will organize a a WSL2 this week to test on

I'm not sure - I ran the "insta run" first, then read instructions and fixed some things later :) Is there a quick fix I can try? I can attach or ssh into the container. When it freezes I can sometimes see activity in OSX like a cursor blinking and the Qemu menu seems OK. Other times I can't tell and Qemu seems locked up, could be a different issue.

I have Catalina running which is pretty sweet - thanks!

jpmorrison commented 2 years ago

I think this is 100% a qemu/X11 issue. I was seeing mouse/keyboard/display freezes. I tried usb-mouse too - barely usable and eventually froze too but bought me enough time to enable SSH and VNC on the guest. Any time the display/mouse was frozen I could still ssh into the guest and shutdown -r

remote-vnc direct to the guest worked fine - no issues as long as I didn't try anything in the qemu/X window.

Maybe an X11 server or DISPLAY issue? I'm using VcXsrv Jan 2021 and TCP/network connection.

Gave up on X and using -nographic -serial null -spice disable-ticketing,port=3001 with spice. Working well with remote-viewer version 10 - just download and install from https://virt-manager.org/download/ Older remote-viewer version 6 and 7 from Ubuntu have mouse issues and are unusable.

sickcodes commented 2 years ago

Thanks @jpmorrison, my mouse freezes when I under RAM the container and even occurs in the video tutorial https://youtu.be/wLezYl77Ll8

I will test the spice version and add it as an option

jpmorrison commented 2 years ago

Sound works too with remote-viewer 10.0 if you install missing DLLs from older versions

RAM=half
AUDIO_DRIVER="spice"

The only problem with remote-viewer is that it always grabs the mouse - I don't know if there's a seamless option.

I have -vga virtio as well but I'm not sure this is any faster - System Info doesn't show the Apple virtio graphics kexts.

At some point I did a restart within macOS and graphics/booting was noticeably faster - pretty comparable to RDP/remote desktop and can watch some YouTube.

sickcodes commented 2 years ago

@jpmorrison I also notice a faster experience using Anydesk to connect. Very noticeable difference actually.

M1ndo commented 10 months ago

I came across the same issue, i got workaround it by using AnyDesk, VNC with ssh tunneling also worked for me. Seems like an issue of QEMU or X11 bug (Unsure)

Hussienfahmy commented 9 months ago

How you used Anydesk? could you please provide commands/steps?