Windows Text Console on SmartOS
With SmartOS the vmadm console
command offers a convenience method for pulling up a text console for a guest VM. This is commonly used for Linux and BSD VMs and it can be enabled for Windows VMs too. The below steps outline how to enable and utilize this feature on Windows 2012 R2 through the use of the Windows Emergency Management Services (EMS).
Configuration
- As an administrator user run the following commands. If you have configured more than one boot entry you may want to tailor this command to target only a specific boot entry. Together these enable EMS and then set it to run on COM1 at a baud rate of 115,200.
C:\>bcdedit /ems on C:\>bcdedit /emssettings EMSPORT:1 EMSBAUDRATE:115200
- From the SmartOS host start up the console and substitute in the appropriate UUID of the VM from
vmadm list
:# vmadm console <uuid>
- Reboot the VM.
- On the console window you will see something like the following:
Computer is booting, SAC started and initialized. Use the "ch -?" command for information about using channels. Use the "?" command for general help. SAC> EVENT: The CMD command is now available. SAC>
- We’re at a SAC prompt, but it’s not yet the familiar CMD.EXE. The SAC is the Special Administration Console which has some additional functionality, one of which is to start CMD. To do so simple run cmd and then switch to the channel that it created:
SAC>cmd The Command Prompt session was successfully launched. EVENT: A new channel has been created. Use "ch -?" for channel help. Channel: Cmd0001 SAC>ch -si 1
- From here press any key and then enter in the username, domain, and password when prompted and CMD prompt will then be usable as well as PowerShell by running
powershell
at the CMD prompt:Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Windows\system32>
Limitations
This does not appear to work on all versions of Windows. When I tried with Windows 7 the bcdedit
commands completed successfully but the console text never appeared. Older versions will need to use the bootcfg
command instead of bcdedit
.
While functional, the serial console can be a bit sluggish at times. Also, when using this within xterm the text scrolls at the 25 line mark rather than filling up the full terminal window.