Strovent SystemsSign in
Reference

Linux on z/VM: CP commands on the 3270 console, #CP or %CP, vmcp and DISCONNECT

On a Linux guest's 3270 console, lines go to Linux. Start a line with #CP or %CP to talk to z/VM, use vmcp from a shell, and DISCONNECT to leave Linux running.

When you log on to the z/VM user ID that runs a Linux guest, the 3270 screen is that guest's virtual console. What you type there goes to Linux, not to z/VM's Control Program (CP). To reach CP, you mark the line, or use a Linux command.

#CP or %CP

Start the line with the line end character followed by CP and the CP command:

#cp query virtual storage
%cp terminal more 5 2

Which character to use:

  • # is the z/VM system default, unless the system operator changed it.
  • % is the default for guests set up with IBM's LINDFLT directory profile for Linux.

To change it for your session, for example to +:

%cp terminal linend +

After that, use the new character. Reconnecting does not reset it.

vmcp from a Linux shell

If your distribution has the vmcp command and the kernel feature behind it (/dev/vmcp), you can send CP commands from a Linux shell instead:

vmcp query userid
vmcp terminal more 5 2

vmcp turns the whole command into uppercase unless you add -k. Escape characters that the shell would expand, such as \*. If CP returns a non-zero code, vmcp writes an error and exits with 1.

Leave Linux running: DISCONNECT

To close the 3270 session but keep the guest running, disconnect instead of logging off:

%cp disconnect

or vmcp disconnect from a shell.

  • While disconnected, output to the virtual console is ignored, unless you have issued SPOOL CONSOLE START to keep it.
  • If the guest stops in a disabled wait, or CP or the guest waits for console input, and no secondary user is set up, z/VM gives you a grace period set by the installation (usually 15 minutes) to log on again before it logs the guest off.
  • You stay disconnected until you log on again. If you then land in CP READ, enter BEGIN to let the guest continue.

The 3270 screen of a Linux console also uses MORE... and HOLDING; TERMINAL MORE sets how long CP waits before clearing the screen. See z/VM "MORE..." and "HOLDING" in the corner of the screen: what to press.

Sources

Spotted a mistake? Email [email protected].