# vimage: "Error: unknown parameter: vnet"



## yavuzg (Jan 29, 2010)

Hello,

I trying to play with vimage but I found something strange. I don't know whether it is a bug.

This is what I have done step by step
1. Kernel recompiled with "options VIMAGE"


```
vi cd /usr/src/sys/i386/conf/GENERIC
/usr/sbin/config GENERIC
cd ../compile/GENERIC
make cleandepend && make depend
```

2. After restart, vimage is installed

```
cd /usr/src/tools/tools/vimage
make
make install
```

3. I tried to create a virtual image as explained in man page, but error occurs


```
vimage -c n0
Error: unknown parameter: vnet
```

4. I found a function call in the code named jail_setv ( line 255)

```
jail_setv( JAIL_CREATE,
"name", argv[0],
"vnet", NULL,
"host", NULL,
"persist", NULL,
"allow.raw_sockets", "true",
"allow.socket_af", "true",
"allow.mount", "true",
NULL)
```

From man page of jai_setv I understood that that parameters after first argument are set via jail_set method. In man page of jail(8) possible parameters are given. name, host, persist, allow.raw_sockets, allow.socket_af and allow.mount are listed in jail(8) but vnet is not defined. I think this is the reason for the error. 

5. I commented out vnet related line ( line 257 ) and recompiled vimage. After small modification, error disappers.

```
vimage -c n0
```

6. But this time vimage -l command does not return anything. 

```
vimage -l
```

on the other hand jls command returns some rows


```
JID IP Adress    Hostname    Path
  1 -                        /
```


Is it a bug or I am doing something wrong?

best regards
yavuz


----------



## yavuzg (Feb 1, 2010)

yavuzg said:
			
		

> Hello,
> 
> ```
> vi cd /usr/src/sys/i386/conf/GENERIC
> ...



Problem solved executing below commands after make depend

```
make && make install
```


----------



## SirDice (Feb 1, 2010)

Please use the preferred way to build/install a kernel:


```
cd /usr/src
make buildkernel
make installkernel
```

Do NOT modify the GENERIC config file. Create a copy of it with a different name and use that. Also change the *ident* line in the config to reflect the name of the config.


----------

