utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
26.83k stars 1.34k forks source link

Mysterious 9p bug: "pread() read only 4096 of 32768" #4984

Open felixstoessel opened 1 year ago

felixstoessel commented 1 year ago

Describe the issue
I use UTM for local web development. I am using Debian 11 (AArch64) and the 9p driver for folder sharing. The sharing works, but after configuring PHP and a NGINX server, I found following issue:

When I call a simple file like http://test.test:12345/test.txt, I could open it until its content is larger than 4096 (bytes/characters), then nothing loads and I get following error in the NGINX log: [alert] 843#843: *145 pread() read only 4096 of 32768 from "/srv/projects/test/www/public/dist/css/app.css" while sending response to client, client: 192.168.64.1, server: test.test, request: "GET /dist/css/app.css HTTP/1.1", host: "test.test:12345"

For the file sharing, I have following in my /etc/fstab: share /media/share 9p trans=virtio,version=9p2000.L,rw,_netdev,nofail 0 0

Some say that it might have something to do with 9p. There are some issues with it. Some say it has something to do with security_model=mapped-xattr. But I am stupid and I have no idea what all this means.

Configuration

ktprograms commented 1 year ago

To clarify, the files are on your host, and you're sharing it to the VM with 9p? Then you're using a Web server to host the shared files?

Can you read the file with a text editor inside the VM?

felixstoessel commented 1 year ago

The URL is called on my host/Mac. Inside the VM/guest, I read the NGINX log and set the 9p sharing.

My main files are on my host. Those files get "mapped" via folder sharing to /media/share inside the guest system. And from there (guest), I configured my NGINX to use the /media/share.

ktprograms commented 1 year ago

I see, thanks for confirming. What happens if you try to cat the files in the guest?

felixstoessel commented 1 year ago

Everything fine with using cat, nothing truncated.

ktprograms commented 1 year ago

I see. You could try this: https://serverfault.com/a/1117222

felixstoessel commented 1 year ago

Didn't work. I tried a lot :)

Elnadrion commented 1 year ago

Hey :) I faced the same error today with mac 13.1, 9p driver and nginx Link above didn't help me as well