# [Solved] How to setup nbd server config?

## solamour

I'm able to use nbd with the following commands.

```
nbd-server 2000 /tmp/file -d
```

```
nbd-client SERVER_IP 2000 /dev/nbd0
```

But whenever I start the server, I see the following warning message.

```
** (process:9104): WARNING **: Specifying an export on the command line is deprecated.

** (process:9104): WARNING **: Please use a configuration file instead.
```

So I created the config file.

```
[generic]

[export]

   exportname = /tmp/file

   port = 2000

```

But when I do "nbd-server -d", the port 2000 is not open (at least not showing in "netstat -a"), and the client isn't able to connect. Please guide me what to look for. Thank you.

__

solLast edited by solamour on Tue Sep 27, 2011 10:07 pm; edited 1 time in total

----------

## solamour

I just noticed that the configuration file described in the previous post (i.e. "/etc/nbd-server/config") works perfectly in Ubuntu 11.04, which has nbd 2.9.16-7.1ubuntu2, whereas Gentoo's latest is 2.9.22. I'm not sure the version difference is the cause of the problem, though.

__

sol

----------

## solamour

It turned out that 2.9.17 or later requires "oldstyle" flag in order to be compatible with the older versions. Perhaps that's why Ubuntu sticks with 2.9.16 as of 11.04 release. When I added the required flag, everything worked as expected.

```
[generic]

   oldstyle = true   <--

[export]

   exportname = /tmp/file

   port = 2000
```

If you want to use the "new" style in 2.9.17 or later, remove both "oldstyle" and "port". The default port 10809 will be used.

```
[generic]

[export]

   exportname = /tmp/file
```

From the client side, you need to provide the name of export.

```
nbd-client SERVER_IP /dev/nbd0 -name export
```

I must say that everything was clearly laid out in the manual page, but the examples there were somewhat misleading.

__

sol

----------

