# CD pass-through for VirtualBox



## user00 (Apr 1, 2014)

Trying to build the firts VM, getting the error below when starting it:

```
Cannot open host device '/dev/cd0' for read/write access. Check the permissions of that device (VERR_ACCESS_DENIED).
```
The user is a member of operators. The following lines were added to/etc/devfs.conf:

```
own     vboxnetctl root:vboxusers
perm    vboxnetctl 0660
perm cd* 0600
perm xpt0 0660
perm pass* 0660
```
/etc/devfs.rules

```
[system=10]
add path 'usb/*' mode 0660 group operator
```
/etc/rc.conf

```
vboxnet_enable="YES"
devfs_system_ruleset="system"
```


----------



## trh411 (Apr 1, 2014)

*Re: Error building VirtualBox from ports*



			
				user00 said:
			
		

> The user is a member of operators. The following lines were added to/etc/devfs.conf:
> 
> ```
> own     vboxnetctl root:vboxusers
> ...


The user may be a member of the operator group, but the group has no RW permissions to cd* with a mode of 0600. Did you mean maybe 0660 like the others?

BTW, you should have opened this as a new topic, rather than piggy-backing on your previous one.


----------



## user00 (Apr 1, 2014)

I was just following the instructions in the handbook: http://www.freebsd.org/doc/handbook/vir ... -host.html
So what exactly am I supposed to do to enable CD access?


----------



## trh411 (Apr 1, 2014)

user00 said:
			
		

> I was just following the instructions in the handbook: http://www.freebsd.org/doc/handbook/vir ... -host.html
> So what exactly am I supposed to do to enable CD access?


My point is that mode 0600 gives *NO* permissions to the group. So even if your user account is part of the operator group, it has no permissions to the /dev/cd* device.

Does it help if you change:

```
perm cd* 0600
-to-
perm cd* 0660
```
in your /etc/devfs.conf file?


----------



## user00 (Apr 1, 2014)

Yes, it does! Problem solved.
Someone with permissions should fix a typo in the handbook now.


----------



## wblock@ (Apr 1, 2014)

user00 said:
			
		

> Yes, it does! Problem solved.
> Someone with permissions should fix a typo in the handbook now.



Be more specific about where that typo is located, and it might happen.


----------



## trh411 (Apr 1, 2014)

wblock@ said:
			
		

> user00 said:
> 
> 
> 
> ...


I just opened a PR for it. Don't have the reference # yet. Error is in 21.3.3, last program listing block.

```
perm cd* 0600
-should be-
perm cd* 0660
```

EDIT: PR is misc/188176


----------



## wblock@ (Apr 1, 2014)

*Re: [SOLVED]CD pass-through for VirtualBox*

Fixed, thanks!


----------



## user00 (Apr 1, 2014)

*Re: [SOLVED]CD pass-through for VirtualBox*

Thank you gentlemen, the other noobs like me will not step into the same trap now. :beergrin


----------



## user00 (Apr 2, 2014)

One issue still remains though. After installing Windows 98SE guest, I cannot get access to its CDROM drive. The device is there, it auto-mounts in Gnome, the VM boots from it, but when inside Windows 98 and it tries to access it, everything hangs.


----------



## trh411 (Apr 2, 2014)

user00 said:
			
		

> One issue still remains though. After installing Windows 98SE guest, I cannot get access to its CDROM drive. The device is there, it auto-mounts in Gnome, the VM boots from it, but when inside Windows 98 and it tries to access it, everything hangs.


I had to re-read your post several times. I kept thinking it said "Windows 98SE guest". :q 

I Google'd around a bit and Windows 98 cannot use CD drive in VirtualBox is all I could find. Don't know if it will help or not as many respondents suggested the CD device can not be used with a Windows 98 guest and others offered potential "solutions". I also found several tutorials on using Windows 98SE with VirtualBox, but none of them specifically addressed an issue with the CD device. Of course all of them were at least six years old.

Unless you have a specific requirement to run Windows 98SE, you might want to try a more recent version of Windows as Windows 98SE is the least well-supported version of Windows as a VirtualBox guest OS.


----------



## user00 (Apr 3, 2014)

The difference being, I can build the same Windows 98 guest VM and it will access CDROM device no problem. In the same physical box, just dual-booted into Linux. This is purely FreeBSD CD device access issue related to VirtualBox.


----------



## trh411 (Apr 3, 2014)

Fair enough. I think you've got your FreeBSD system configured properly to support access to the CD device from any guest OS. If it does not work for a Windows 98SE guest, which I would consider to be an edge case, I'm afraid I am at a loss to know what might be wrong.

Have you encountered any CD device access issues with any other guest OS?


----------



## wblock@ (Apr 3, 2014)

Why not dd(1) the CD into an ISO image and use that directly?  No pass-through needed.


----------



## user00 (Apr 4, 2014)

trh411 said:
			
		

> Have you encountered any CD device access issues with any other guest OS?


Figured out that passthrough mode did not work!
Turned it off and Win98 or XP can access host's CDROM. In passthrough mode both freeze.


----------



## trh411 (Apr 4, 2014)

user00 said:
			
		

> trh411 said:
> 
> 
> 
> ...


Now that is interesting. I'm not sure I would have ever thought to try that. Thanks for sharing the solution.


----------

