uml_mconsole


uml_mconsole is the UML control utility. It allows a UML instance to be controlled from the host and allows information to be extracted from the UML instance. It is one client of several for the MConsole protocol, which communicates with a driver inside UML.

It can be run in either single-shot mode, where the request is specified on the command line, or in command-line mode, where the user interacts with the uml_mconsole command line to make multiple requests of a UML instance.

The single-shot usage is:

uml_mconsole umid request


  • umid is the name given to the UML instance. This is specified on the UML command line. If none is provided there, the instance will create a random umid, which will be visible in the boot log.

  • request is what will be sent to the UML instance. This is described fully below.

A single-shot request will send the request to the UML instance, wait for a response, and then exit. The exit code will be zero if the request succeeded and nonzero otherwise.

The command-line usage is:

uml_mconsole umid


uml_mconsole will present a prompt consisting of the umid of the UML instance that requests will be sent to. In this mode, there are two commands available that are handled by uml_mconsole and are not sent to the UML instance.

  • switch new-umid changes the UML instance to which requests will be sent to the one whose umid is new-umid. The prompt will change to reflect this.

  • quit exits uml_mconsole.

A few commands are implemented within the uml_mconsole client and are available in both modes.

  • mconsole-version prints the version of the uml_mconsole client. This is different from the UML version that the version command returns.

  • help prints all of the available commands and their usage.

  • int sends an interrupt (SIGINT) to the UML instance. If it is running under gdb, this will break out to the gdb prompt. If it isn't, this will cause a shutdown of the UML instance.

    The commands sent to the UML instance are as follows.

  • version returns the kernel version of the UML instance.

  • halt performs a shutdown of the kernel. This will not perform a clean shutdown of the distribution. For this, see the cad command below. halt is useful when the UML instance can't run a full shutdown for some reason.

  • reboot is similar to halt except that the UML instance reboots.

  • config dev=config adds a new device to a UML instance. See Table 8.1 for a list of device and configuration syntax.

  • config dev queries the configuration of a UML device. See Table 8.1 for a list of device syntax.

  • remove dev removes a device from a UML instance. See Table 8.1 for a list of device syntax.

  • sysrq letter performs the sysrq action specified by the given letter. This is the same as you would type on the keyboard to invoke the host's sysrq handler. These are summarized in Table 8.2.

  • cad invokes the Ctrl-Alt-Del handler in the UML instance. The effect of this is controlled by the ca entry in the instance's /etc/ inittab. Usually this is to perform a shutdown. If a reboot is desired, /etc/inittab should be changed accordingly.

  • stop pauses the UML instance until it receives a go command. In the meantime, it will do nothing but respond to MConsole commands.

  • go continues the UML instance after a stop.

  • log string makes the UML instance enter the string into its kernel log.

  • log -f filename is a uml_mconsole extension to the log command. It sends the contents of filename to the UML instance to be written to the kernel log.

  • proc file returns the contents of the UML instance's /proc/ file. This works only on normal files, so it can't be used to list the contents of a directory.

  • stack pid returns the stack of the specified process ID within the UML instance. This is duplicated by one of the SysRq optionsthe real purpose of this command is to wake up the specified process and make it hit a breakpoint so that it can be examined with gdb.




User Mode Linux
User Mode Linux
ISBN: 0131865056
EAN: 2147483647
Year: N/A
Pages: 116
Authors: Jeff Dike

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net