Page 1 of 1

How to start a machine with given PID

Posted: 25. Sep 2015, 18:44
by Porsche_maniak
Hi there. I am running on win 7 and was wondering this.
Can I start a virtual machine with a given pid number (like 1111) ? It could be from shortcut or cmd doesn't matter.
The thing is that only with PIDS I can control and monitor given machine internet speeds (Netlimiter is the program) so it has to be static.
Currently each start and stop of the machine goes with random PID.

Thanks

Re: How to start a machine with given PID

Posted: 25. Sep 2015, 19:08
by scottgus1
If I understand properly a process is given a PID as it starts, not before. So I'd surmise that no you couldn't start a guest by PID, since it doesn't have one before it starts.

Edit: Re-reading, it seems you want to force the PID to a certain value? Sounds like a Windows thing more than a Virtualbox thing. Try googling for it.

But you can query running processes using the Windows command "tasklist". And I think you can also find the correct Virtualbox guest process by querying the command line used to start the guest. Such info appears in the hover tag in Process Explorer, so it ought to be findable in a programming language. Maybe WMI or Powershell? Google for how to find the PID of a running process.

Re: How to start a machine with given PID

Posted: 25. Sep 2015, 19:20
by Porsche_maniak
Yes I want to set the PID manually and yes seems like windows question although I was hoping for inbuild function in vbox that does that.
I know I can use tasklist to track the real PID but that's not what I need.
Like in widnows the System process is always set with PID 4 .. It sounds theoretically possible..

Re: How to start a machine with given PID

Posted: 25. Sep 2015, 19:26
by scottgus1
Haven't ever seen such a thing in Virtualbox itself, probably because it's the Windows system that runs the process and so has to pick a PID for the process it's about to start.

Re: How to start a machine with given PID

Posted: 25. Sep 2015, 19:46
by Martin
Porsche_maniak wrote:Like in widnows the System process is always set with PID 4 .. It sounds theoretically possible..
The 'system' process in Windows doesn't set/select its PID, it is just the fourth process which gets started in the boot process. :wink: