A VM's window shows one of two things: its display, the screen the guest draws, or its serial console, the text the guest writes to its serial port. The display is for desktops and installers. The console is a terminal: it works before the network is up, when the display shows nothing, and in VMs that have no desktop at all.
| Guest | Display | Serial console |
|---|---|---|
| macOS | Accelerated graphics | Off by default. Often silent. |
| Linux | Unaccelerated Virtio graphics | On by default. A login prompt on hvc0. |
| FreeBSD | The loader only | Always on. FreeBSD's console, with a login prompt. |
| Windows | MacVisor's display or Apple's | Not available. |
Switch between them
- Linux and FreeBSD VMs have a Display | Console switch in the window's toolbar, just left of the guest tools status. It shows which one is on.
- Any VM with a serial console, macOS included, has View → Show Console and Show Display (⌃⌘C).
The window opens on the display, except a FreeBSD VM's, which turns to its console once FreeBSD writes to it, unless you chose Display first. Your choice lasts until the VM shuts down, a Restart included, and isn't kept for the next start.
Turn the console on
VM Settings → Advanced → Devices → Serial Console. It's on by default for new Linux VMs, always on for FreeBSD VMs, off by default for macOS VMs, and not available for Windows VMs.
It applies to the machine as it started. Turned on while the VM runs or is suspended, it takes a restart, and View → Show Console says so; the toolbar switch appears at the next start. A suspended VM resumes with the devices it was saved with, so shut it down rather than suspending it.
The guest's console output is also written to console.log in the VM's package, rolled over to console.log.1 at 16 MiB, so a guest that prints without end can't fill the Mac's disk.
Sign in at the console
Linux
A Linux VM shows its login prompt on the console: systemd's getty on hvc0. It takes an account that has a password.
-
A VM installed from an ISO: the account you made in the installer.
-
Ubuntu Desktop: your account, with the password from Show Password on the Overview. Type Password types it for you.
-
A VM made from a cloud image: the account has no password, only your SSH keys, so it can't sign in at the console. Give it one while SSH still works, so the console is there when it doesn't:
mvz shell dev sudo passwd "$USER"
Which messages appear above the prompt depends on the distribution: some send the kernel's boot messages to the console, and some only the login prompt.
FreeBSD
FreeBSD's console is on the guest's /dev/ttyV0.0. The window shows FreeBSD's loader first, then the console, with its login prompt, about a minute into the boot. Sign in as your account with the password you chose in New VM, or the random one MacVisor made: Show Password and Type Password on the Overview's FreeBSD VM card, or mvz password <vm>. root can't sign in there. See FreeBSD guests.
A FreeBSD VM made with MacVisor 27.2.0 or earlier, and one imported from another app, have no login prompt on the console until you add one. See FreeBSD VMs made before.
macOS
A macOS VM often writes nothing to its serial port, and the console says Nothing on the serial console yet. Use the display.
Working in the console
- Type Password (⌃⌘V) types the VM's account password into the console while it shows. It never presses Return.
- The Edit menu has Copy, Paste and Select All while the console shows. VM → Type Clipboard is for the display, and is off while the console shows. See Type Password and Type Clipboard.
- When the guest rings its bell, the console flashes once, rather than beeping, at most once a second. Nothing flashes while the display shows, or for output from before the window opened.
- The console shows text, colours and cursor movement, so login prompts,
vi,nanoandtopwork. Anything else the guest sends is dropped before it's shown: inline graphics (Kitty, Sixel, iTerm images), clipboard writes (OSC 52), file transfers, links and notifications. A guest can't use the console to act on the Mac. - A window opened after the VM started shows the console's recent output, so the login prompt is there.
In Terminal: mvz console
mvz console dev # attach; Control-] detaches
mvz console bsd --raw # pass the guest's output as it is
mvz console attaches your terminal to the same console. Every key, Control-C included, goes to the guest; only Control-] stays with mvz and detaches. It ends by itself when the VM stops.
- It needs Serial Console on, and the VM running. A FreeBSD VM always has it.
- Up to 8 terminals can attach at once. Each sees the guest's output, and what any of them types goes to the guest. One detaching touches none of the others. A ninth is told "Console busy: 8 terminals are attached already. Detach one (Ctrl-]) and try again." The VM's window can show the console meanwhile.
- As in the window, the guest's graphics, clipboard writes, file transfers, links, notifications and window titles are dropped before your terminal reads them.
--rawpasses everything as it comes, for a guest whose console uses terminal features you trust. - When it ends, by Control-], the VM stopping, or the terminal closing,
mvz consoleputs your terminal back: its settings, and the modes and colours the guest may have changed (mouse reporting, the alternate screen, a hidden cursor).
When to use which
| Task | Use |
|---|---|
| A desktop, an installer with a graphical screen, a macOS or Windows VM | The display |
| Signing in to a FreeBSD VM without SSH | The console |
| A Linux VM whose network doesn't come up | The console, if the account has a password |
| Watching a VM boot, or a VM that hangs before its desktop | The console, and console.log |
| An appliance | Its web UI or SSH; the console if it runs a login prompt on its serial port |
| Everyday work in a Linux or FreeBSD VM | SSH: mvz shell <vm> or Open in Terminal |
VMs without a window
A VM can run without a window in two ways, and the console is how you reach either one without the network.
- Started without a window:
mvz start <vm> --headless, a VM set to start at login in the background, or one whose window you closed. It still has a display. Open its window withmvz open <vm>, or from the library.mvz screenshotneeds the window shown since the start. - Headless in its settings: VM Settings → Display → Headless gives the VM no display at all, for servers and automation. It has no window to open:
mvz opensays so, and Type Password has nothing to type into. Reach it over SSH, or withmvz console <vm>.
In both, mvz console works as long as Serial Console is on.
See also Run and control VMs and the display settings.
DeltaSync