How to start a machine with given PID

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Porsche_maniak
Posts: 17
Joined: 25. Sep 2015, 18:40

How to start a machine with given PID

Post 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
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: How to start a machine with given PID

Post 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.
Porsche_maniak
Posts: 17
Joined: 25. Sep 2015, 18:40

Re: How to start a machine with given PID

Post 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..
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: How to start a machine with given PID

Post 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.
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: How to start a machine with given PID

Post 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:
Post Reply