PDA

View Full Version : Using nbd to share CDROM between machines



cjmills
28th November 2017, 01:05 PM
Hi All,

I am experiencing an issue with sharing a CDROM between two machines over my home network; the host being CentOS 7 and the client Fedora 27. I think the fix might be simple however can't seem to work it out myself. Would appreciate any guidance given on the topic.

Below are the commands and configuration details I am using on the machine hosting the CDROM.

[root@host ~]# nbd-server -V
This is nbd-server version 3.14

[root@host ~]# cat /etc/nbd-server/config
[generic]

[cdrom]
exportname = /dev/sr0

[root@host ~]# systemctl start nbd-server.service
[root@host ~]# systemctl status nbd-server.service
● nbd-server.service - Network Block Device server
Loaded: loaded (/usr/lib/systemd/system/nbd-server.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2017-11-27 07:11:58 EST; 2s ago
Docs: man:nbd-server(1)
man:nbd-server(5)
Process: 25036 ExecStart=/usr/bin/nbd-server $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 25037 (nbd-server)
CGroup: /system.slice/nbd-server.service
└─25037 /usr/bin/nbd-server

Nov 27 07:11:58 host systemd[1]: Starting Network Block Device server...
Nov 27 07:11:58 host systemd[1]: Started Network Block Device server.

[root@host ~]# firewall-cmd --list-all
internal (active)
target: default
icmp-block-inversion: no
interfaces: enp2s0
sources: 192.168.1.0/24
.....
rich rules:
rule source mac="AA:BB:5C:5D:EE:" port port="10809" protocol="tcp" accept

And here are the commands and errors experienced when trying to connect from the client.

[root@client ~]# nbd-client -v
This is nbd-client, from nbd 3.16.2

[root@client ~]# nbd-client host -N cdrom /dev/nbd0
Negotiation: ..Error: Read failed: Connection reset by peer
size = 252552705MB
bs=1024, sz=264820705393664 bytes

[root@client ~]# journalctl -f
Nov 28 06:56:22 client nbd_client[15971]: Read failed: Connection reset by peer
Nov 28 06:56:22 client kernel: block nbd0: Receive control failed (result -32)
Nov 28 06:56:22 client kernel: block nbd0: shutting down sockets
Nov 28 06:56:22 client nbd_client[15971]: Exiting.

Any help provided will be much appreciated! If you need any extra details please contact me.

CJ