File: UserModeLinux-HOWTO-10.html

package info (click to toggle)
user-mode-linux-doc 20020523-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,592 kB
  • ctags: 340
  • sloc: makefile: 32
file content (202 lines) | stat: -rw-r--r-- 5,249 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
 <TITLE>User Mode Linux HOWTO : The Management Console</TITLE>
 <LINK HREF="UserModeLinux-HOWTO-11.html" REL=next>
 <LINK HREF="UserModeLinux-HOWTO-9.html" REL=previous>
 <LINK HREF="UserModeLinux-HOWTO.html#toc10" REL=contents>
</HEAD>
<BODY>
<A HREF="UserModeLinux-HOWTO-11.html">Next</A>
<A HREF="UserModeLinux-HOWTO-9.html">Previous</A>
<A HREF="UserModeLinux-HOWTO.html#toc10">Contents</A>
<HR>
<H2><A NAME="mconsole"></A> <A NAME="s10">10.</A> <A HREF="UserModeLinux-HOWTO.html#toc10">The Management Console</A></H2>

<P> </P>
<P>The UML management console is a low-level interface to the kernel,
somewhat like the i386 SysRq interface.  Since there is a full-blown
operating system under UML, there is much greater flexibility possible
than with the SysRq mechanism.</P>
<P> 
At this point, there are three things you can do with the mconsole
interface:
<UL>
<LI>get the kernel version
</LI>
<LI>add and remove devices
</LI>
<LI>halt or reboot the machine
</LI>
</UL>
</P>
<P> 
You need the mconsole client (uml_mconsole) which is present in CVS
(/tools/mconsole) in 2.4.5-9um and later, and will be in the RPM in 2.4.6.</P>
<P> 
You also need CONFIG_MCONSOLE (under 'General Setup') enabled in UML.
When you boot UML, you'll see a line like:
<BLOCKQUOTE><CODE>
<PRE>
mconsole initialized on /home/jdike/.uml/umlNJ32yL/mconsole
</PRE>
</CODE></BLOCKQUOTE>

If you specify a unique machine id one the UML command line, i.e.
<BLOCKQUOTE><CODE>
<PRE>
umid=debian
</PRE>
</CODE></BLOCKQUOTE>

you'll see this 
<BLOCKQUOTE><CODE>
<PRE>
mconsole initialized on /home/jdike/.uml/debian/mconsole
</PRE>
</CODE></BLOCKQUOTE>

That file is the socket that uml_mconsole will use to communicate
with UML.  Run it with either the umid or the full path as its argument:
<BLOCKQUOTE><CODE>
<PRE>
uml_mconsole debian
</PRE>
</CODE></BLOCKQUOTE>

or
<BLOCKQUOTE><CODE>
<PRE>
uml_mconsole /home/jdike/.uml/debian/mconsole
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>You'll get a prompt, at which you can run one of these commands:
<UL>
<LI>version
</LI>
<LI>halt
</LI>
<LI>reboot
</LI>
<LI>config
</LI>
<LI>remove
</LI>
<LI>sysrq
</LI>
<LI>help
</LI>
<LI>cad
</LI>
</UL>
</P>

<H2><A NAME="ss10.1">10.1</A> <A HREF="UserModeLinux-HOWTO.html#toc10.1">version</A>
</H2>

<P>This takes no arguments.  It prints the UML version.
<BLOCKQUOTE><CODE>
<PRE>
(mconsole) version
OK Linux usermode 2.4.5-9um #1 Wed Jun 20 22:47:08 EDT 2001 i686
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H2><A NAME="ss10.2">10.2</A> <A HREF="UserModeLinux-HOWTO.html#toc10.2">halt and reboot</A>
</H2>

<P>These take no arguments.  They shut the machine down immediately, with
no syncing of disks and no clean shutdown of userspace.  So, they are
pretty close to crashing the machine.
<BLOCKQUOTE><CODE>
<PRE>
(mconsole) halt
OK
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H2><A NAME="ss10.3">10.3</A> <A HREF="UserModeLinux-HOWTO.html#toc10.3">config</A>
</H2>

<P>&quot;config&quot; adds a new device to the virtual machine.  Currently the
ubd and network drivers support this.  It takes one argument, which is
the device to add, with the same syntax as the kernel command line.
<BLOCKQUOTE><CODE>
<PRE>
(mconsole) config ubd3=/home/jdike/incoming/roots/root_fs_debian22 
OK
(mconsole) config eth1=mcast
OK
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H2><A NAME="ss10.4">10.4</A> <A HREF="UserModeLinux-HOWTO.html#toc10.4">remove</A>
</H2>

<P>&quot;remove&quot; deletes a device from the system.  Its argument is just the
name of the device to be removed. The device must be idle in
whatever sense the driver considers necessary.  In the case of the ubd
driver, the removed block device must not be mounted, swapped on, or
otherwise open, and in the case of the network driver, the device must be down.
<BLOCKQUOTE><CODE>
<PRE>
(mconsole) remove ubd3
OK
(mconsole) remove eth1
OK
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H2><A NAME="ss10.5">10.5</A> <A HREF="UserModeLinux-HOWTO.html#toc10.5">sysrq</A>
</H2>

<P>This takes one argument, which is a single letter.  It calls the
generic kernel's SysRq driver, which does whatever is called for by
that argument.  See the SysRq documentation in Documentation/sysrq.txt
in your favorite kernel tree to see what letters are valid and what
they do.</P>


<H2><A NAME="ss10.6">10.6</A> <A HREF="UserModeLinux-HOWTO.html#toc10.6">help</A>
</H2>

<P>&quot;help&quot; returns a string listing the valid commands and what each one does.</P>


<H2><A NAME="ss10.7">10.7</A> <A HREF="UserModeLinux-HOWTO.html#toc10.7">cad</A>
</H2>

<P>This invokes the Ctl-Alt-Del action on init.  What exactly this ends
up doing is up to /etc/inittab.  Normally, it reboots the machine.
With UML, this is usually not desired, so if a halt would be better,
then find the section of inittab that looks like this
<BLOCKQUOTE><CODE>
<PRE>
# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
</PRE>
</CODE></BLOCKQUOTE>

and change the command to halt.</P>






<HR>
<A HREF="UserModeLinux-HOWTO-11.html">Next</A>
<A HREF="UserModeLinux-HOWTO-9.html">Previous</A>
<A HREF="UserModeLinux-HOWTO.html#toc10">Contents</A>
</BODY>
</HTML>