xref: /dflybsd-src/share/man/man7/vkernel.7 (revision cf4f0088e9428da0982b86ec1408e98d1bcd5386)
14af18995SSascha Wildner.\"
298b2ba80SSascha Wildner.\" Copyright (c) 2006, 2007
34af18995SSascha Wildner.\"	The DragonFly Project.  All rights reserved.
44af18995SSascha Wildner.\"
54af18995SSascha Wildner.\" Redistribution and use in source and binary forms, with or without
64af18995SSascha Wildner.\" modification, are permitted provided that the following conditions
74af18995SSascha Wildner.\" are met:
84af18995SSascha Wildner.\"
94af18995SSascha Wildner.\" 1. Redistributions of source code must retain the above copyright
104af18995SSascha Wildner.\"    notice, this list of conditions and the following disclaimer.
114af18995SSascha Wildner.\" 2. Redistributions in binary form must reproduce the above copyright
124af18995SSascha Wildner.\"    notice, this list of conditions and the following disclaimer in
134af18995SSascha Wildner.\"    the documentation and/or other materials provided with the
144af18995SSascha Wildner.\"    distribution.
154af18995SSascha Wildner.\" 3. Neither the name of The DragonFly Project nor the names of its
164af18995SSascha Wildner.\"    contributors may be used to endorse or promote products derived
174af18995SSascha Wildner.\"    from this software without specific, prior written permission.
184af18995SSascha Wildner.\"
194af18995SSascha Wildner.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
204af18995SSascha Wildner.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
214af18995SSascha Wildner.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
224af18995SSascha Wildner.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
234af18995SSascha Wildner.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
244af18995SSascha Wildner.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
254af18995SSascha Wildner.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
264af18995SSascha Wildner.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
274af18995SSascha Wildner.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
284af18995SSascha Wildner.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
294af18995SSascha Wildner.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
304af18995SSascha Wildner.\" SUCH DAMAGE.
314af18995SSascha Wildner.\"
32*cf4f0088SMatthew Dillon.\" $DragonFly: src/share/man/man7/vkernel.7,v 1.40 2008/05/27 23:26:38 dillon Exp $
334af18995SSascha Wildner.\"
3443cfb771SSascha Wildner.Dd May 6, 2008
354af18995SSascha Wildner.Dt VKERNEL 7
364af18995SSascha Wildner.Os
374af18995SSascha Wildner.Sh NAME
380592e24dSSascha Wildner.Nm vkernel ,
3998b2ba80SSascha Wildner.Nm vcd ,
400592e24dSSascha Wildner.Nm vkd ,
410592e24dSSascha Wildner.Nm vke
424af18995SSascha Wildner.Nd virtual kernel architecture
434af18995SSascha Wildner.Sh SYNOPSIS
4465d7306bSSascha Wildner.Cd "platform vkernel"
4598b2ba80SSascha Wildner.Cd "device vcd"
46c8e7d028SSascha Wildner.Cd "device vkd"
47c8e7d028SSascha Wildner.Cd "device vke"
48c8e7d028SSascha Wildner.Pp
4979b58aaeSMatthew Dillon.Pa /var/vkernel/kernel
5003071031SSascha Wildner.Op Fl sUv
51a72d8a9fSMatthew Dillon.Op Fl c Ar file
5209b03fffSSascha Wildner.Op Fl e Ar name Ns = Ns Li value : Ns Ar name Ns = Ns Li value : Ns ...
53dd54cb3aSSascha Wildner.Op Fl i Ar file
5409b03fffSSascha Wildner.Op Fl I Ar interface Ns Op Ar :address1 Ns Oo Ar :address2 Oc Ns Oo Ar /netmask Oc
55702acf06SJoe Talbott.Op Fl l Ar cpulock
564af18995SSascha Wildner.Op Fl m Ar size
57c5b0b0baSMatthew Dillon.Op Fl n Ar numcpus
58b02b4170SMatthew Dillon.Op Fl p Ar file
594af18995SSascha Wildner.Op Fl r Ar file
604af18995SSascha Wildner.Sh DESCRIPTION
614af18995SSascha WildnerThe
624af18995SSascha Wildner.Nm
634af18995SSascha Wildnerarchitecture allows for running
644af18995SSascha Wildner.Dx
654af18995SSascha Wildnerkernels in userland.
664af18995SSascha Wildner.Pp
674af18995SSascha WildnerThe following options are available:
684af18995SSascha Wildner.Bl -tag -width ".Fl m Ar size"
69a72d8a9fSMatthew Dillon.It Fl c Ar file
707834fbccSSascha WildnerSpecify a readonly CD-ROM image
71a72d8a9fSMatthew Dillon.Ar file
72a72d8a9fSMatthew Dillonto be used by the kernel, with the first
73a72d8a9fSMatthew Dillon.Fl c
74a72d8a9fSMatthew Dillonoption defining
75a72d8a9fSMatthew Dillon.Li vcd0 ,
76a72d8a9fSMatthew Dillonthe second one
77a72d8a9fSMatthew Dillon.Li vcd1 ,
78a72d8a9fSMatthew Dillonand so on.  The first
79a72d8a9fSMatthew Dillon.Fl r
80a72d8a9fSMatthew Dillonor
81a72d8a9fSMatthew Dillon.Fl c
82a72d8a9fSMatthew Dillonoption specified on the command line will be the boot disk.
837834fbccSSascha WildnerThe CD9660 filesystem is assumed when booting from this media.
8409b03fffSSascha Wildner.It Fl e Ar name Ns = Ns Li value : Ns Ar name Ns = Ns Li value : Ns ...
8509b03fffSSascha WildnerSpecify an environment to be used by the kernel.
86dd54cb3aSSascha Wildner.It Fl i Ar file
87dd54cb3aSSascha WildnerSpecify a memory image
88dd54cb3aSSascha Wildner.Ar file
89dd54cb3aSSascha Wildnerto be used by the virtual kernel.
90dd54cb3aSSascha WildnerIf no
91dd54cb3aSSascha Wildner.Fl i
92dd54cb3aSSascha Wildneroption is given, the kernel will generate a name of the form
93dd54cb3aSSascha Wildner.Pa /var/vkernel/memimg.XXXXXX ,
94dd54cb3aSSascha Wildnerwith the trailing
95dd54cb3aSSascha Wildner.Ql X Ns s
96dd54cb3aSSascha Wildnerbeing replaced by a sequential number, e.g.\&
97dd54cb3aSSascha Wildner.Pa memimg.000001 .
9809b03fffSSascha Wildner.It Fl I Ar interface Ns Op Ar :address1 Ns Oo Ar :address2 Oc Ns Oo Ar /netmask Oc
9909b03fffSSascha WildnerCreate a virtual network device, with the first
10009b03fffSSascha Wildner.Fl I
10109b03fffSSascha Wildneroption defining
1020592e24dSSascha Wildner.Li vke0 ,
10309b03fffSSascha Wildnerthe second one
1040592e24dSSascha Wildner.Li vke1 ,
10509b03fffSSascha Wildnerand so on.
10609b03fffSSascha Wildner.Pp
10709b03fffSSascha WildnerThe
10809b03fffSSascha Wildner.Ar interface
10909b03fffSSascha Wildnerargument is the name of a
11009b03fffSSascha Wildner.Xr tap 4
11109b03fffSSascha Wildnerdevice node.
11209b03fffSSascha WildnerThe
11309b03fffSSascha Wildner.Pa /dev/
11409b03fffSSascha Wildnerpath prefix does not have to be specified and will be automatically prepended.
11509b03fffSSascha WildnerSpecifying
11609b03fffSSascha Wildner.Cm auto
11709b03fffSSascha Wildnerwill pick the first unused
11809b03fffSSascha Wildner.Xr tap 4
11909b03fffSSascha Wildnerdevice.
12009b03fffSSascha Wildner.Pp
12109b03fffSSascha WildnerThe
12209b03fffSSascha Wildner.Ar address1
12309b03fffSSascha Wildnerand
12409b03fffSSascha Wildner.Ar address2
12509b03fffSSascha Wildnerarguments are the IP addresses of the
12609b03fffSSascha Wildner.Xr tap 4
12709b03fffSSascha Wildnerand
1280592e24dSSascha Wildner.Nm vke
12909b03fffSSascha Wildnerinterfaces.
13009b03fffSSascha WildnerOptionally,
13109b03fffSSascha Wildner.Ar address1
13209b03fffSSascha Wildnermay be of the form
13309b03fffSSascha Wildner.Li bridge Ns Em X
13409b03fffSSascha Wildnerin which case the
13509b03fffSSascha Wildner.Xr tap 4
13609b03fffSSascha Wildnerinterface is added to the specified
13709b03fffSSascha Wildner.Xr bridge 4
13809b03fffSSascha Wildnerinterface.
139a8cc122dSSascha WildnerThe
140a8cc122dSSascha Wildner.Nm vke
141a8cc122dSSascha Wildneraddress is not assigned until the interface is brought up in the guest.
14209b03fffSSascha Wildner.Pp
14309b03fffSSascha WildnerThe
14409b03fffSSascha Wildner.Ar netmask
14509b03fffSSascha Wildnerargument applies to all interfaces for which an address is specified.
146702acf06SJoe Talbott.It Fl l Ar cpulock
147702acf06SJoe TalbottSpecify which, if any, real CPUs to lock virtual CPUs to.
148702acf06SJoe Talbott.Ar cpulock
149702acf06SJoe Talbottis one of
150702acf06SJoe Talbott.Cm any ,
15126ea2793SSascha Wildner.Cm map Ns Op Ns , Ns Ar startCPU ,
15226ea2793SSascha Wildneror
15326ea2793SSascha Wildner.Ar CPU .
154702acf06SJoe Talbott.Pp
155702acf06SJoe Talbott.Cm any
15626ea2793SSascha Wildnerdoes not map virtual CPUs to real CPUs.
15726ea2793SSascha WildnerThis is the default.
158702acf06SJoe Talbott.Pp
159702acf06SJoe Talbott.Cm map Ns Op Ns , Ns Ar startCPU
160702acf06SJoe Talbottmaps each virtual CPU to a real CPU starting with real CPU 0 or
161702acf06SJoe Talbott.Ar startCPU
162702acf06SJoe Talbottif specified.
163702acf06SJoe Talbott.Pp
164702acf06SJoe Talbott.Ar CPU
16526ea2793SSascha Wildnerlocks all virtual CPUs to the real CPU specified by
16626ea2793SSascha Wildner.Ar CPU .
1674af18995SSascha Wildner.It Fl m Ar size
1684af18995SSascha WildnerSpecify the amount of memory to be used by the kernel in bytes,
1694af18995SSascha Wildner.Cm K
1703cea05a4SSascha Wildner.Pq kilobytes ,
1714af18995SSascha Wildner.Cm M
1723cea05a4SSascha Wildner.Pq megabytes
1733cea05a4SSascha Wildneror
1744af18995SSascha Wildner.Cm G
1753cea05a4SSascha Wildner.Pq gigabytes .
17609b03fffSSascha WildnerLowercase versions of
1774af18995SSascha Wildner.Cm K , M ,
1784af18995SSascha Wildnerand
1794af18995SSascha Wildner.Cm G
1804af18995SSascha Wildnerare allowed.
181c5b0b0baSMatthew Dillon.It Fl n Ar numcpus
1828cf87c92SSascha WildnerSpecify the number of CPUs you wish to emulate.
18343cfb771SSascha WildnerUp to 16 CPUs are supported.
1848cf87c92SSascha WildnerThe virtual kernel must be built with
1858cf87c92SSascha Wildner.Cd options SMP
1868cf87c92SSascha Wildnerto use this option and will default to 2 CPUs unless otherwise specified.
187b02b4170SMatthew Dillon.It Fl p Ar file
188b02b4170SMatthew DillonSpecify a file in which to store the process ID.
189b02b4170SMatthew DillonA warning is issued if this file cannot be opened for writing.
1904af18995SSascha Wildner.It Fl r Ar file
191a72d8a9fSMatthew DillonSpecify a R/W disk image
1924af18995SSascha Wildner.Ar file
193ec1a8a4dSSascha Wildnerto be used by the kernel, with the first
194ec1a8a4dSSascha Wildner.Fl r
195ec1a8a4dSSascha Wildneroption defining
1960592e24dSSascha Wildner.Li vkd0 ,
197ec1a8a4dSSascha Wildnerthe second one
1980592e24dSSascha Wildner.Li vkd1 ,
199a72d8a9fSMatthew Dillonand so on.  The first
200a72d8a9fSMatthew Dillon.Fl r
201a72d8a9fSMatthew Dillonor
202a72d8a9fSMatthew Dillon.Fl c
203a72d8a9fSMatthew Dillonoption specified on the command line will be the boot disk.
204c8e7d028SSascha Wildner.It Fl s
205c8e7d028SSascha WildnerBoot into single-user mode.
20603071031SSascha Wildner.It Fl U
20703071031SSascha WildnerEnable writing to kernel memory and module loading.
20803071031SSascha WildnerBy default, those are disabled for security reasons.
2094af18995SSascha Wildner.It Fl v
2104af18995SSascha WildnerTurn on verbose booting.
2114af18995SSascha Wildner.El
2120592e24dSSascha Wildner.Sh DEVICES
2130592e24dSSascha WildnerA number of virtual device drivers exist to supplement the virtual kernel.
2140592e24dSSascha Wildner.Ss Disk device
2150592e24dSSascha WildnerThe
2160592e24dSSascha Wildner.Nm vkd
2170592e24dSSascha Wildnerdriver allows for up to 16
2180592e24dSSascha Wildner.Xr vn 4
2190592e24dSSascha Wildnerbased disk devices.
2200592e24dSSascha WildnerThe root device will be
2210592e24dSSascha Wildner.Li vkd0
2220592e24dSSascha Wildner(see
2230592e24dSSascha Wildner.Sx EXAMPLES
2240592e24dSSascha Wildnerfor further information on how to prepare a root image).
22598b2ba80SSascha Wildner.Ss CD-ROM device
22698b2ba80SSascha WildnerThe
22798b2ba80SSascha Wildner.Nm vcd
22898b2ba80SSascha Wildnerdriver allows for up to 16 virtual CD-ROM devices.
22998b2ba80SSascha WildnerBasically this is a read only
23098b2ba80SSascha Wildner.Nm vkd
23198b2ba80SSascha Wildnerdevice with a block size of 2048.
2320592e24dSSascha Wildner.Ss Network interface
2330592e24dSSascha WildnerThe
2340592e24dSSascha Wildner.Nm vke
2350592e24dSSascha Wildnerdriver supports up to 16 virtual network interfaces which are associated with
2360592e24dSSascha Wildner.Xr tap 4
2370592e24dSSascha Wildnerdevices on the host.
2380592e24dSSascha WildnerFor each
2390592e24dSSascha Wildner.Nm vke
2400592e24dSSascha Wildnerdevice, the per-interface read only
2410592e24dSSascha Wildner.Xr sysctl 3
2420592e24dSSascha Wildnervariable
2430592e24dSSascha Wildner.Va hw.vke Ns Em X Ns Va .tap_unit
2440592e24dSSascha Wildnerholds the unit number of the associated
2450592e24dSSascha Wildner.Xr tap 4
2460592e24dSSascha Wildnerdevice.
2471e4d9fd9SSascha Wildner.Sh SIGNALS
248bb195a01SMatthew DillonThe virtual kernel only enables
249bb195a01SMatthew Dillon.Dv SIGQUIT
250bb195a01SMatthew Dillonand
251bb195a01SMatthew Dillon.Dv SIGTERM
252bb195a01SMatthew Dillonwhile operating in regular console mode.
253bb195a01SMatthew DillonSending
2541e4d9fd9SSascha Wildner.Ql \&^\e
2551e4d9fd9SSascha Wildner.Pq Dv SIGQUIT
256bb195a01SMatthew Dillonto the virtual kernel causes the virtual kernel to enter its internal
2571e4d9fd9SSascha Wildner.Xr ddb 4
258bb195a01SMatthew Dillondebugger and re-enable all other terminal signals.
259bb195a01SMatthew DillonSending
260bb195a01SMatthew Dillon.Dv SIGTERM
261bb195a01SMatthew Dillonto the virtual kernel triggers a clean shutdown by passing a
262bb195a01SMatthew Dillon.Dv SIGUSR2
263bb195a01SMatthew Dillonto the virtual kernel's
264bb195a01SMatthew Dillon.Xr init 8
265bb195a01SMatthew Dillonprocess.
266974b26bfSSascha Wildner.Sh DEBUGGING
267974b26bfSSascha WildnerIt is possible to directly gdb the virtual kernel's process.
268974b26bfSSascha WildnerIt is recommended that you do a
269974b26bfSSascha Wildner.Ql handle SIGSEGV noprint
2704010bf94SNicolas Theryto ignore page faults processed by the virtual kernel itself and
271e7c2f376SNicolas Thery.Ql handle SIGUSR1 noprint
2724010bf94SNicolas Theryto ignore signals used for simulating inter-processor interrupts (SMP build
2734010bf94SNicolas Theryonly).
274c8e7d028SSascha Wildner.Sh EXAMPLES
2754af18995SSascha WildnerA couple of steps are necessary in order to prepare the system to build and
2764af18995SSascha Wildnerrun a virtual kernel.
2774af18995SSascha Wildner.Ss Setting up the filesystem
2784af18995SSascha WildnerThe
2794af18995SSascha Wildner.Nm
2804af18995SSascha Wildnerarchitecture needs a number of files which reside in
2814af18995SSascha Wildner.Pa /var/vkernel .
2824af18995SSascha WildnerSince these files tend to get rather big and the
2834af18995SSascha Wildner.Pa /var
2844af18995SSascha Wildnerpartition is usually of limited size, we recommend the directory to be
2854af18995SSascha Wildnercreated in the
2864af18995SSascha Wildner.Pa /home
2874af18995SSascha Wildnerpartition with a link to it in
2884af18995SSascha Wildner.Pa /var :
289c8e7d028SSascha Wildner.Bd -literal
2904af18995SSascha Wildnermkdir /home/var.vkernel
2914af18995SSascha Wildnerln -s /home/var.vkernel /var/vkernel
2924af18995SSascha Wildner.Ed
2934af18995SSascha Wildner.Pp
2944af18995SSascha WildnerNext, a filesystem image to be used by the virtual kernel has to be
295c8e7d028SSascha Wildnercreated and populated (assuming world has been built previously):
296c8e7d028SSascha Wildner.Bd -literal
2974af18995SSascha Wildnerdd if=/dev/zero of=/var/vkernel/rootimg.01 bs=1m count=2048
2984af18995SSascha Wildnervnconfig -c -s labels vn0 /var/vkernel/rootimg.01
29958c55700SSascha Wildnerdisklabel -r -w vn0s0 auto
30058c55700SSascha Wildnerdisklabel -e vn0s0	# edit the label to create a vn0s0a partition
30158c55700SSascha Wildnernewfs /dev/vn0s0a
30258c55700SSascha Wildnermount /dev/vn0s0a /mnt
303c8e7d028SSascha Wildnercd /usr/src
304c8e7d028SSascha Wildnermake installworld DESTDIR=/mnt
305c8e7d028SSascha Wildnercd etc
306c8e7d028SSascha Wildnermake distribution DESTDIR=/mnt
3077a3238b8SMatthew Dillonecho '/dev/vkd0s0a	/	ufs	rw	1  1' >/mnt/etc/fstab
3087a3238b8SMatthew Dillonecho 'proc		/proc	procfs	rw	0  0' >>/mnt/etc/fstab
3097834fbccSSascha Wildner.Ed
3107834fbccSSascha Wildner.Pp
3117834fbccSSascha WildnerEdit
3127834fbccSSascha Wildner.Pa /mnt/etc/ttys
3137834fbccSSascha Wildnerand replace the
3147834fbccSSascha Wildner.Li console
3157834fbccSSascha Wildnerentry with the following line and turn off all other gettys.
3167834fbccSSascha Wildner.Bd -literal
3177834fbccSSascha Wildnerconsole	"/usr/libexec/getty Pc"		cons25	on  secure
3187834fbccSSascha Wildner.Ed
3197834fbccSSascha Wildner.Pp
3207834fbccSSascha WildnerThen, unmount the disk.
3217834fbccSSascha Wildner.Bd -literal
3224af18995SSascha Wildnerumount /mnt
3234af18995SSascha Wildnervnconfig -u vn0
3244af18995SSascha Wildner.Ed
3254af18995SSascha Wildner.Ss Compiling the virtual kernel
3264af18995SSascha WildnerIn order to compile a virtual kernel use the
3274af18995SSascha Wildner.Li VKERNEL
3284af18995SSascha Wildnerkernel configuration file residing in
3294af18995SSascha Wildner.Pa /usr/src/sys/config
3304af18995SSascha Wildner(or a configuration file derived thereof):
331c8e7d028SSascha Wildner.Bd -literal
3324af18995SSascha Wildnercd /usr/src
33309b03fffSSascha Wildnermake -DNO_MODULES buildkernel KERNCONF=VKERNEL
33479b58aaeSMatthew Dillonmake -DNO_MODULES installkernel KERNCONF=VKERNEL DESTDIR=/var/vkernel
3354af18995SSascha Wildner.Ed
3364af18995SSascha Wildner.Ss Enabling virtual kernel operation
3374af18995SSascha WildnerA special
3384af18995SSascha Wildner.Xr sysctl 8 ,
3394af18995SSascha Wildner.Va vm.vkernel_enable ,
3404af18995SSascha Wildnermust be set to enable
3414af18995SSascha Wildner.Nm
3424af18995SSascha Wildneroperation:
343c8e7d028SSascha Wildner.Bd -literal
3444af18995SSascha Wildnersysctl vm.vkernel_enable=1
3454af18995SSascha Wildner.Ed
34609b03fffSSascha Wildner.Ss Configuring the network on the host system
34709b03fffSSascha WildnerIn order to access a network interface of the host system from the
34809b03fffSSascha Wildner.Nm ,
34909b03fffSSascha Wildneryou must add the interface to a
35009b03fffSSascha Wildner.Xr bridge 4
35109b03fffSSascha Wildnerdevice which will then be passed to the
35209b03fffSSascha Wildner.Fl I
35309b03fffSSascha Wildneroption:
35409b03fffSSascha Wildner.Bd -literal
35509b03fffSSascha Wildnerkldload if_bridge.ko
35609b03fffSSascha Wildnerkldload if_tap.ko
35709b03fffSSascha Wildnerifconfig bridge0 create
35809b03fffSSascha Wildnerifconfig bridge0 addm re0	# assuming re0 is the host's interface
35909b03fffSSascha Wildnerifconfig bridge0 up
36009b03fffSSascha Wildner.Ed
3614af18995SSascha Wildner.Ss Running the kernel
3624af18995SSascha WildnerFinally, the virtual kernel can be run:
363c8e7d028SSascha Wildner.Bd -literal
36479b58aaeSMatthew Dilloncd /var/vkernel
36579b58aaeSMatthew Dillon\&./kernel -m 64m -r /var/vkernel/rootimg.01 -I auto:bridge0
3664af18995SSascha Wildner.Ed
367c8e7d028SSascha Wildner.Pp
36879b58aaeSMatthew DillonYou can issue the
36979b58aaeSMatthew Dillon.Xr reboot 8 ,
37079b58aaeSMatthew Dillon.Xr halt 8 ,
37179b58aaeSMatthew Dillonor
37279b58aaeSMatthew Dillon.Xr shutdown 8
37379b58aaeSMatthew Dilloncommands from inside a virtual kernel.
37479b58aaeSMatthew DillonAfter doing a clean shutdown the
375c8e7d028SSascha Wildner.Xr reboot 8
37679b58aaeSMatthew Dilloncommand will re-exec the virtual kernel binary while the other two will
37779b58aaeSMatthew Dilloncause the virtual kernel to exit.
37834caba04SMatthew Dillon.Sh BUILDING THE WORLD UNDER A VKERNEL
37934caba04SMatthew DillonThe virtual kernel platform does not have all the header files expected
38034caba04SMatthew Dillonby a world build, so the easiest thing to do right now is to specify a
38134caba04SMatthew Dillonpc32 target when building the world under a virtual kernel, like this:
38234caba04SMatthew Dillon.Bd -literal
38334caba04SMatthew Dillonvkernel# make MACHINE_PLATFORM=pc32 buildworld
38434caba04SMatthew Dillonvkernel# make MACHINE_PLATFORM=pc32 installworld
38534caba04SMatthew Dillon.Ed
38679b58aaeSMatthew Dillon.Sh CONFIGURATION FILES
38763568417SSascha WildnerYour virtual kernel is a complete
38863568417SSascha Wildner.Dx
38963568417SSascha Wildnersystem, but you might not want to run all the services a normal kernel runs.
39079b58aaeSMatthew DillonHere is what a typical virtual kernel's
39179b58aaeSMatthew Dillon.Pa /etc/rc.conf
39279b58aaeSMatthew Dillonfile looks like, with some additional possibilities commented out.
39379b58aaeSMatthew Dillon.Bd -literal
39479b58aaeSMatthew Dillonhostname="vkernel"
39579b58aaeSMatthew Dillonnetwork_interfaces="lo0 vke0"
39679b58aaeSMatthew Dillonifconfig_vke0="DHCP"
39779b58aaeSMatthew Dillonsendmail_enable="NO"
39879b58aaeSMatthew Dillon#syslog_enable="NO"
39966931b32SSascha Wildnerblanktime="NO"
40079b58aaeSMatthew Dillon.Ed
4014af18995SSascha Wildner.Sh SEE ALSO
40209b03fffSSascha Wildner.Xr bridge 4 ,
40309b03fffSSascha Wildner.Xr tap 4 ,
404c8e7d028SSascha Wildner.Xr vn 4 ,
405c8e7d028SSascha Wildner.Xr build 7 ,
406c8e7d028SSascha Wildner.Xr disklabel 8 ,
40709b03fffSSascha Wildner.Xr ifconfig 8 ,
408dbfd168bSMatthew Dillon.Xr vknetd 8 ,
409*cf4f0088SMatthew Dillon.Xr vknet 1 ,
410c8e7d028SSascha Wildner.Xr vnconfig 8
4114af18995SSascha Wildner.Sh HISTORY
4124af18995SSascha WildnerVirtual kernels were introduced in
4134af18995SSascha Wildner.Dx 1.7 .
4144af18995SSascha Wildner.Sh AUTHORS
4154af18995SSascha Wildner.An -nosplit
4164af18995SSascha Wildner.An Matt Dillon
4174af18995SSascha Wildnerthought up and implemented the
4184af18995SSascha Wildner.Nm
4190592e24dSSascha Wildnerarchitecture and wrote the
4200592e24dSSascha Wildner.Nm vkd
4210592e24dSSascha Wildnerdevice driver.
4220592e24dSSascha Wildner.An Sepherosa Ziehau
4230592e24dSSascha Wildnerwrote the
4240592e24dSSascha Wildner.Nm vke
4250592e24dSSascha Wildnerdevice driver.
4264af18995SSascha WildnerThis manual page was written by
4274af18995SSascha Wildner.An Sascha Wildner .
428