Page 1 of 1

Change the mounted CD image from within the guest..?

Posted: 7. Nov 2016, 23:42
by spinjector
Is it possible to change the mounted ISO in the virtual CD drive from within a guest VM..? Like by dos commands through the Guest Additions drivers or something like that..?

I checked the manual and didn't see anything, and Google search results weren't useful because the search keywords are too common. Thanks.

Re: Change the mounted CD image from within the guest..?

Posted: 8. Nov 2016, 08:34
by BillG
Yes you can. From the toolbar at the top click Devices>Optical Drive>Choose disk image... then select the image you want to use. You can release the current image from the same menu.

Re: Change the mounted CD image from within the guest..?

Posted: 8. Nov 2016, 09:15
by socratis
Bill, the actions you describe are from the host menu. I believe what the OP is asking, is if there is anything completely from within the guest. Example follows:

@spinjector
If you're thinking of a VirtualBox command to change the VM settings (that's what a mounted image is), then no. Thankfully no, if I may add, as I wouldn't want my guest to have any control and/or affecting the host or its own configuration. None.

You can go as far as the guest OS can permit you, if a native command for such an action exists. For example, I can eject a CD on my OSX guest by issuing the command:
  • hdiutil detach [options] <devname>
and similarly I can mount accessible disk images with a similar command:
  • hdiutil attach <image>
I'm sure something like that exists under Linux, don't know the exact command and/or syntax. Not sure at all about Windows (but I'm not that optimistic).

Note what I said about accessible. If I see it in the guest, I can mount it. I cannot mount something that is on the host. So, for example, that means I cannot programmatically mount the guest additions CD from within the guest. Host intervention is required, therefore it is not addressing your question.

Re: Change the mounted CD image from within the guest..?

Posted: 9. Nov 2016, 21:12
by spinjector
socratis wrote:I wouldn't want my guest to have any control and/or affecting the host or its own configuration. None.
Thanks, I hadn't thought about the security aspect of it.
socratis wrote:similarly I can mount accessible disk images
Can you explain what you mean about accessible images..?

The reason this issue came up, I started thinking about an old CD-Changer I used to have (which may in fact still be a one of my various boxes of computer junk). It looked like a standard 5-1/4" CD drive, but it was a slot-loader, and you could stuff it with 6 different CDs. It was pretty slick. Then...you could select them in various ways, such as a Systray app, or it could even tag each CD with its own drive letter. And that being said, I recall there were MONSTER changers back in the 90s that could hold like 250 CD or DVD discs, but I don't know how they were selected.

And now that I've typed that last paragraph, I'm working through this in my head and thinking I could accomplish this simply in software. There are apps such as CDImage and Alcohol 120 that have their own virtual CD drive software, where you select an ISO file and it auto-magically pops up as a vCD drive. I could restrict the "available" images by putting them in a read-only VHD (immutable?), or better yet, a VBox Shared Machine Folder set to read-only.

Thanks for the ideas. =-)

Re: Change the mounted CD image from within the guest..?

Posted: 9. Nov 2016, 21:23
by socratis
spinjector wrote:Can you explain what you mean about accessible images..?
It's explained in the paragraph following that rhetorical statement in that same post of mine.
spinjector wrote:better yet, a VBox Shared Machine Folder set to read-only.
That would qualify them as accessible... ;)
Yes, if you can achieve it from the guest via Alcohol or simple scripting, even better. You didn't mention your guest, but Win > 8 has that capability built-in. Good luck with the endeavor...

Re: Change the mounted CD image from within the guest..?

Posted: 9. Nov 2016, 22:38
by spinjector
Thank you. No, not Win8. These are guests with 2000 and XP. :lol:

Re: Change the mounted CD image from within the guest..?

Posted: 10. Nov 2016, 03:22
by BillG
socratis wrote:Bill, the actions you describe are from the host menu. I believe what the OP is asking, is if there is anything completely from within the guest. Example follows:

.
Umm... no they are not. I admit that they are not from within the guest OS but they are from the Devices tab on the guest window toolbar.

Re: Change the mounted CD image from within the guest..?

Posted: 10. Nov 2016, 10:34
by socratis
BillG wrote:they are from the Devices tab on the guest window toolbar
... which are on the host: toolbar, window and menu. And you have no access whatsoever from the guest, thank Zeus! ;)

In fact, the only "menu items" that you might have control over from the guest side, are the ones exposed from 'VBoxControl':
VBoxControl takesnapshot
VBoxControl savestate
VBoxControl suspend
VBoxControl poweroff
PS. What I just realized, you know, hmm? No documentation there is for "VboxControl". File a bug report, I will. Yeesssssss....
PPS. Filed, bug report #16176 was. Yes, hmmm...
</yoda_speak>