An RS-232 serial console allows Linux to be controlled from a terminal or modem attached to an asynchronous serial port. The monitor, mouse and keyboard are no longer required for system administration. Serial consoles are useful where Linux systems are deployed at remote sites or are deployed in high-density racks. This HOWTO describes how to configure Linux to attach a serial console. I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303. I'm a beginner at minicom. Is this the correct command to execute? Or do I need to configure something?
-->
The Serial Console in the Azure portal provides access to a text-based console for Windows virtual machines (VMs) and virtual machine scale set instances. This serial connection connects to the COM1 serial port of the VM or virtual machine scale set instance, providing access to it independent of the network or operating system state. The serial console can only be accessed by using the Azure portal and is allowed only for those users who have an access role of Contributor or higher to the VM or virtual machine scale set.
Serial Console works in the same manner for VMs and virtual machine scale set instances. In this doc, all mentions to VMs will implicitly include virtual machine scale set instances unless otherwise stated.
For serial console documentation for Linux, see Azure Serial Console for Linux.
Note
The Serial Console is generally available in global Azure regions. It is not yet available in Azure government or Azure China clouds.
Prerequisites
Enable Serial Console functionality for Windows Server
Note
If you are not seeing anything in the serial console, make sure that boot diagnostics is enabled on your VM or virtual machine scale set.
Enable the serial console in custom or older images
Newer Windows Server images on Azure have Special Administration Console (SAC) enabled by default. SAC is supported on server versions of Windows but isn't available on client versions (for example, Windows 10, Windows 8, or Windows 7).
For older Windows Server images (created before February 2018), you can automatically enable the serial console through the Azure portal's run command feature. In the Azure portal, select Run command, then select the command named EnableEMS from the list.
Alternatively, to manually enable the serial console for Windows VMs/virtual machine scale set created before February 2018, follow these steps:
If needed, the SAC can be enabled offline as well:
How do I know if SAC is enabled?
If SAC isn't enabled, the serial console won't display the SAC prompt. In some cases, VM health information is shown, and in other cases it's blank. If you're using a Windows Server image created before February 2018, SAC probably won't be enabled.
Enable the Windows boot menu in the serial console
If you need to enable Windows boot loader prompts to display in the serial console, you can add the following additional options to your boot configuration data. For more information, see bcdedit.
Note
The timeout that you set for the boot manager menu to display will impact your OS boot time. If you think the 10-second timeout value is too short or too long, set it to a different value.
Use Serial ConsoleUse CMD or PowerShell in Serial Console
Use the serial console for NMI calls
A non-maskable interrupt (NMI) is designed to create a signal that software on a virtual machine won't ignore. Historically, NMIs have been used to monitor for hardware issues on systems that required specific response times. Today, programmers and system administrators often use NMI as a mechanism to debug or troubleshoot systems that are not responding.
The serial console can be used to send an NMI to an Azure virtual machine by using the keyboard icon in the command bar. After the NMI is delivered, the virtual machine configuration will control how the system responds. Windows can be configured to crash and create a memory dump file when receiving an NMI.
For information on configuring Windows to create a crash dump file when it receives an NMI, see How to generate a crash dump file by using an NMI.
Use function keys in serial console
Function keys are enabled for usage for serial console in Windows VMs. The F8 in the serial console dropdown provides the convenience of easily entering the Advanced Boot Settings menu, but serial console is compatible with all other function keys. You may need to press Fn + F1 (or F2, F3, etc.) on your keyboard depending on the computer you are using serial console from.
Use WSL in serial console
The Windows Subsystem for Linux (WSL) has been enabled for Windows Server 2019 or later, so it is also possible to enable WSL for use within the serial console if you are running Windows Server 2019 or later. This may be beneficial for users that also have a familiarity with Linux commands. For instructions to enable WSL for Windows Server, see the Installation guide.
Restart your Windows VM/virtual machine scale set instance within Serial Console
You can initiate a restart within the serial console by navigating to the power button and clicking 'Restart VM'. This will initiate a VM restart, and you will see a notification within the Azure portal regarding the restart.
This is useful in situations where you may want to access the boot menu without leaving the serial console experience.
Disable the Serial Console
By default, all subscriptions have serial console access enabled. You can disable the serial console at either the subscription level or VM/virtual machine scale set level. For detailed instructions, visit Enable and disable the Azure Serial Console.
![]() Serial console securityAccess security
Access to the serial console is limited to users who have an access role of Virtual Machine Contributor or higher to the virtual machine. If your Azure Active Directory tenant requires multi-factor authentication (MFA), then access to the serial console will also need MFA because the serial console's access is through the Azure portal.
Channel security
All data that is sent back and forth is encrypted on the wire.
Audit logs
All access to the serial console is currently logged in the boot diagnostics logs of the virtual machine. Access to these logs are owned and controlled by the Azure virtual machine administrator.
Caution
No access passwords for the console are logged. However, if commands run within the console contain or output passwords, secrets, user names, or any other form of personally identifiable information (PII), those will be written to the VM boot diagnostics logs. They will be written along with all other visible text, as part of the implementation of the serial console's scroll back function. These logs are circular and only individuals with read permissions to the diagnostics storage account have access to them. However, we recommend following the best practice of using the Remote Desktop for anything that may involve secrets and/or PII.
Concurrent usage
If a user is connected to the serial console and another user successfully requests access to that same virtual machine, the first user will be disconnected and the second user connected to the same session.
Caution
This means that a user who's disconnected won't be logged out. The ability to enforce a logout upon disconnect (by using SIGHUP or similar mechanism) is still in the roadmap. For Windows, there's an automatic timeout enabled in SAC; for Linux, you can configure the terminal timeout setting.
Accessibility
Accessibility is a key focus for the Azure serial console. To that end, we've ensured that the serial console is accessible for the visual and hearing impaired, as well as people who might not be able to use a mouse.
Keyboard navigation
Use the Tab key on your keyboard to navigate in the serial console interface from the Azure portal. Your location will be highlighted on screen. To leave the focus of the serial console window, press Ctrl+F6 on your keyboard.
Use the serial console with a screen reader
The serial console has screen reader support built in. Navigating around with a screen reader turned on will allow the alt text for the currently selected button to be read aloud by the screen reader.
Common scenarios for accessing the serial console
Known issues
We're aware of some issues with the serial console and the VM's operating system. Here's a list of these issues and steps for mitigation for Windows VMs. These issues and mitigations apply for both VMs and virtual machine scale set instances. If these don't match the error you're seeing, see the common serial console service errors at Common Serial Console errors.
Frequently asked questions
Q. How can I send feedback?
A. Provide feedback by creating a GitHub issue at https://aka.ms/serialconsolefeedback. Alternatively (less preferred), you can send feedback via [email protected] or in the virtual machine category of https://feedback.azure.com.
Q. Does the serial console support copy/paste?
A. Yes. Use Ctrl+Shift+C and Ctrl+Shift+V to copy and paste into the terminal.
Q. Who can enable or disable the serial console for my subscription?
A. To enable or disable the serial console at a subscription-wide level, you must have write permissions to the subscription. Roles that have write permission include administrator or owner roles. Custom roles can also have write permissions.
Q. Who can access the serial console for my VM?
A. You must have the Virtual Machine Contributor role or higher for a VM to access the VM's serial console.
Q. My serial console isn't displaying anything, what do I do?
A. Your image is likely misconfigured for serial console access. For information about configuring your image to enable the serial console, see Enable the serial console in custom or older images.
Q. Is the serial console available for virtual machine scale sets?
A. Yes, it is! See Serial Console for Virtual Machine Scale Sets
Next steps
Active4 months ago
I am trying to connect minicom to a serial device that is connected via a USB-to-serial adapter. This is a PL2303 and from everything I've read no additional drivers are required. The device is recognised as a PL2303.
I'm a beginner at minicom. Is this the correct command to execute? Or do I need to configure something?
Peter Mortensen
14.5k1919 gold badges8989 silver badges118118 bronze badges
codingJoecodingJoe
1,65199 gold badges3737 silver badges5656 bronze badges
10 Answers
First check with
dmesg | grep tty if system recognize your adapter.Then try to run minicom with sudo minicom -s , go to 'Serial port setup' and change the first line to /dev/ttyUSB0 .
Don't forget to save config as default with 'Save setup as dfl'. It works for me on Ubuntu 11.04 on VirtualBox.
MatejMatej
1,18111 gold badge1111 silver badges2424 bronze badges
You will need to set the permissions every time you plug the converter in.I use PuTTY to connect. In order to do so, I have created a little Bash script to sort out the permissions and launch PuTTY:
P.S. I would never recommend that permissions are set to 777.
Peter Mortensen
14.5k1919 gold badges8989 silver badges118118 bronze badges
McPartyMcParty
The serial port communication programs
moserial or gtkterm provide an easy way to check connectivity and modify /dev/ttyUSB0 (or /dev/ttyUSB1 !) settings. Even though there maybe only a single USB to RS232 adapter, the n designation /dev/ttyUSBn Marcy elliptical machine. can and does change periodically! Both moserial and gtkterm will show what port designation is relevant in their respective pull down menus when selecting an appropriate port to use.
Check out help.ubuntu.com/community/Minicom for details on
minicom .
EkimEkim
Serial Console Ubuntu
I had fix this with
adduser *username* dialout . I never had this error again, even though previously the only way to get it to work was to reboot the PC or unplug and replug the usb to serial adapter.
RomanRoman
Long time reader, first time helper ;)
I'm going through the same
hellish experience here with a Prolific USB <> Serial adapter and so far Linux is the easiest to get it to work.
On CentOS, I didn't need to install any drivers etc. That said,
However, this helped: https://www.centos.org/forums/viewtopic.php?t=21271
So install minicom (
yum install minicom ) then enter its settings (minicom -s ).
Then select
Serial Port Setup and change the Serial Device (Option A) to /dev/ttyUSB0, or whatever your device file is as it slightly differs per distro.
Then change the Bps (Option E) to 9600 and the rest should be default (8N1 Y N)
Save as default, then simply
minicom and Bob's your uncle.
![]()
HTH.
Sam GreadlySam Greadly
I get get the same minicom error, 'cannot open /dev/ttyUSB0: No such file or directory'
Three notes:
I am running Ubuntu 10.04 LTS (Lucid Lynx) under VMware (running on Windows 7). In this situation, make sure the device is attached to VM operating system by right clicking on the USB/Serial USB icon in the lower right of the VMware window and select Connect (Disconnect from Host).
Remember to press Ctrl + A to get minicom's prompt, and type X to exit the program. Just exiting the terminal session running minicom will leave the process running.
Peter Mortensen
14.5k1919 gold badges8989 silver badges118118 bronze badges
user1271729
I had the exact same problem, and it was fixed by doing a Peter Mortensen
chmod 777 /dev/ttyUSB0 . I never had this error again, even though previously the only way to get it to work was to reboot the VM or unplug and replug the USB-to-serial adapter. I am running Ubuntu 10.04 (Lucid Lynx) VM on OS X.
14.5k1919 gold badges8989 silver badges118118 bronze badges
Joshua EtienneJoshua Etienne
I suggest that newbies connect a PL2303 to Ubuntu, chmod 777 /dev/ttyUSB0 (file-permissions) and connect to a CuteCom serial terminal. The CuteCom UI is simple intuitive. If the PL2303 is continuously broadcasting data, then Cutecom will display data in hex format
gatorbackgatorback
23911 gold badge44 silver badges2424 bronze badges
I just got my GUC232A cable with a molded-in PL2302 converter chip.
In addition to adding myself and br to group
dialout , I found this helpful tip in the README.Debian file in /usr/share/doc/bottlerocket :
This package uses debconf to configure the /dev/firecracker symlink, should you need to change the symlink in the future run this command:
dpkg-reconfigure -pmedium bottlerocket
Connect Windows To Linux Serial Console
That will then prompt you for your new serial port and modify the symlink. This is required for proper use of bottlerocket.
I did that and voila! bottlerocket is able to communicate with my X-10devices.
Peter Mortensen
14.5k1919 gold badges8989 silver badges118118 bronze badges
DexterIsMyHeroDexterIsMyHero
Putty on ubuntuThere is no need to install the driver for PL2303So only type the command to enable the puttySudo chmod 666 /dev/ttyUSB0DoneOpen the putty.
Nikhil ParasharNikhil Parashar
Linux Connect To Serial ConsoleNot the answer you're looking for? Browse other questions tagged linuxserial-portusbhardware-interface or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |