Running a VM without keyboard attached to guest

This is for discussing general topics about how to use VirtualBox.
Post Reply
PhilV
Posts: 2
Joined: 11. Dec 2015, 11:13

Running a VM without keyboard attached to guest

Post by PhilV »

Is there anyway I can run a VM without a keyboard attached?
I am testing an installation script and it automatically switches to an "interactive" install if it detects that there is a keyboard attached. If there is no keyboard attached then it should perform an automated headless style install.

I've looked at using vboxmanage but the closest I got was:

Code: Select all

VBoxManage.exe modifyvm "MyTestVm" --keyboard ps2
It seems that this will take only one of two arguments, 'ps2' or 'usb'. Ideally what I am looking for is a third 'none' option.

Is there anyway to achieve this (perhaps I am looking in the wrong place), or do I need to add this as a feature request?

Many 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: Running a VM without keyboard attached to guest

Post by scottgus1 »

I've never heard of a Virtualbox method to cause no keyboard to be presented to the guest. You could try disabling the keyboard in the guest OS.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: Running a VM without keyboard attached to guest

Post by michaln »

PhilV wrote:Is there anyway I can run a VM without a keyboard attached?
No. Consider fixing your script.
PhilV
Posts: 2
Joined: 11. Dec 2015, 11:13

Re: Running a VM without keyboard attached to guest

Post by PhilV »

scottgus1 wrote:I've never heard of a Virtualbox method to cause no keyboard to be presented to the guest. You could try disabling the keyboard in the guest OS.
Thanks for the reply Scott. Disabling the keyboard in the unfortunately isn't an option as this is a bootable ISO that I am testing, so at that point there is no guest OS (other than that that is on the ISO, and hardcoding that to have / not have a keyboard would defeat the purpose of what I am trying to test).
michaln wrote:
PhilV wrote:Is there anyway I can run a VM without a keyboard attached?
No. Consider fixing your script.
The script is fixed. The whole point of the script is that it is a single installation script that will automatically switch between interactive / automated depending on whether there is a 'user interface' (i.e. keyboard) attached.
I was hoping to be able to test it on VirtualBox, but if I cannot tell the Guest VM that there is NO keyboard attached I cannot do that.

Oh well, back to real hardware then I guess... :?
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: Running a VM without keyboard attached to guest

Post by michaln »

PhilV wrote:The script is fixed. The whole point of the script is that it is a single installation script that will automatically switch between interactive / automated depending on whether there is a 'user interface' (i.e. keyboard) attached.
Sorry, that sounds broken to me. For example on most server systems I know, there is no keyboard physically attached (usually), yet an emulated keyboard will be always present... but most of the time, there won't be anyone using it, and in fact the admin might not even be able to use it at all (ssh/remote desktop only).

The traditional logic is to run in non-interactive mode when the console is redirected. That of course has nothing to do with whether a keyboard is physically attached or not.
Post Reply