vmcp - Send CP commands to the z/VM hypervisor

6.10 z/VM guest

Use the vmcp command to send control program (CP) commands to the z/VM® hypervisor and display the response from z/VM.

The vmcp command expects the command line as a parameter and returns the response to stdout. Error messages are written to stderr.

You can issue CP commands through the /dev/vmcp device node or with the vmcp command. In both cases, the vmcp module must be compiled into the kernel.

vmcp syntax

Read syntax diagramSkip visual syntax diagramvmcp-k-b 8k-b <size><command>
Where:
-k or --keepcase
preserves the case of the characters in the specified command string. By default, the command string is converted to uppercase characters.
-b <size> or --buffer=<size>
specifies the buffer size in bytes for the response from z/VM CP. Valid values are from 4096 (or 4k) up to 1048756 (or 1M). By default, vmcp allocates an 8192 byte (8k) buffer. You can use k and M to specify kilo- and megabytes. The suffixes are not case sensitive, so k is equivalent to K and m is equivalent to M.
<command>
specifies the command that you want to send to CP.
-h or --help
displays help information. To view the man page, enter man vmcp.
-v or --version
displays version information.
If the command completes successfully, vmcp returns 0. Otherwise, vmcp returns one of the following values:
  1. CP returned a non-zero response code.
  2. The specified buffer was not large enough to hold CP's response. The command was run, but the response was truncated. You can use the --buffer option to increase the response buffer.
  3. Linux® reported an error to vmcp. See the error message for details.
  4. The options that are passed to vmcp were erroneous. See the error messages for details.

Examples

  • To get your user ID issue:
    # vmcp query userid 
  • To attach the device 1234 to your guest, issue:
    # vmcp attach 1234 \*
  • If you add the following line to /etc/sudoers:
    ALL ALL=NOPASSWD:/sbin/vmcp indicate
    every user on the system can run the indicate command by using:
    # sudo vmcp indicate
  • If you need a larger response buffer, use the --buffer option:
    # vmcp --buffer=128k q 1-ffff