I've been calling virsh from my .Net Core console app in Linux using Proccess.start
for many month but suddenly I get a permission error:
Permission denied
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at wconfig.Menus.MAIN.Test(Object& Obj)
- I run my .Net Core app as root
- I can run virsh commands fine from shell
- I can run virsh commands fine with
Process.Start
if I usebash -c MyVirshCmd...
- I can run other commands in my .Net Core app fine, I've only seen the problem with virsh
Something strange is happening in the native .net core function ForkAndExecProcess
and virsh.
.Net Core code example:
Dim PI As New ProcessStartInfo
PI.RedirectStandardOutput = False
PI.FileName = "virsh"
PI.Arguments = "list --all"
Using proc As New Process
proc.StartInfo = PI
proc.Start()
End Using
In the /etc/libvirt/qemu.conf config file it says The user for QEMU processes run by the system instance.
?
I've tried to set user
and group
in the file to "root" but it didn't help.
In desperation I tried to restart server, didn't help of course.
I cannot think of anything that has changed on the server, it just stopped working yesterday out of the blue.
Using Debian Buster (10)
I'm lost?