0

Can I mount mount /dev folder from remote computer with linux, then make link on local host for remote kvm file and use it with qemu-kvm? Like #qemu-systemx-86_64 --enable-kvm. I mount the remote directory with sshfs and make symbolic link to remote kvm at local /dev dir. When I run qemu it says failed to initialize KVM: Permission denied

2
  • 1
    What are you trying to accomplish? The /dev directory is full of abstractions of local system devices, so accessing it from a remote system isn't going to be useful in any way. But perhaps I just don't know what you're trying to do.
    – Spooler
    Mar 30, 2019 at 21:41
  • I want to use KVM IO abstraction to run VM on laptop, but do all calculations and memory access on remote machine, which is more powerful.
    – Pavel
    Apr 1, 2019 at 10:18

1 Answer 1

1

No, you can't export a /dev directory via sshfs, NFS, or similar (or any other pseudo-filesystem). Those aren't "real" files that can be accessed in that way. They are accessible locally, and are for interacting with local phenomena.

That being said, it is possible to do things like send disk contents over ssh to a remote disk, but that's not done by copying the device file - it's done by streaming the device file into ssh via something like dd, and then using a remotely executed dd to accept that standard input from ssh, like so:

dd if=/dev/sda | ssh user@computer dd of=/dev/sda

It's also possible to have structured in-memory message send/receive queues with RDMA, but that's a large subject on its own and might not be what you're looking for if you just want to share an application memory space between machines.

And if you do want to share an application's memory between machines, that will probably need to be done asynchronously (as replicating memory is expensive and very prone to latency issues), and it will need to be done within the application. It will have to be designed to do that, which KVM/QEMU is not.

2
  • From what I understood /dev/kvm represents an abstraction for queue, which is used by hypervisor to handle southbridge's activity. KVM-complete kernel processes vm's threads as if they were usual native threads with lower privileges. And when it comes to do some MMIO/PMIO instructions it merely puts a message into /dev/kvm, which has to be processed by user-level application.
    – Pavel
    Apr 28, 2019 at 9:21
  • But that's an abstraction for a local data on that node. That file is meaningless when accessed outside of the context of that node. I don't want to say that exporting that data is impossible - it's probably possible. But it would not be done by exporting this file itself. You must read the data from it using some other program, then send that data by some means (similar to my example with sending a disk to another machine using dd over ssh).
    – Spooler
    Apr 28, 2019 at 15:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .