GNS3 / gns3-gui

GNS3 Graphical Network Simulator
http://www.gns3.com
GNU General Public License v3.0
2.18k stars 436 forks source link

-drive option forbidden #3628

Closed g1augusto closed 2 months ago

g1augusto commented 2 months ago

GNS3 Version: GNS3 v2.2.49

Operating System: Windows GUI and Linux bare metal server

I have a VM template created with specific -drive options in QEMU but for some strange reason these are forbidden to be used in the GNS3 GUI with the following error message:

Forbidden additional option: -drive

At first I thought it was something that QEMU itself rejected and then I tried with two different versions (8.2.6 and 7.2.12) from the GNS3 server command line and it booted correctly.

Why this limitation? what is the purpose of it? Is there any way to overcome it or is it just a mistake?

These are the two options causing this:

-drive if=pflash,format=raw,readonly=on,file="/firmware/OVMF_CODE.fd" 
-drive if=pflash,format=raw,file="/firmware/OVMF_VARS-1024x768.fd" 

PS: I have tried to use the gui disk image option as pflash and pass the path of the files but it didn't work

cristian-ciobanu commented 2 months ago

@g1augusto you can check this commit related to your problem https://github.com/GNS3/gns3-server/commit/b194e48649bfe8078466a6ace0a9d5368bc03e38

I think if you add this line into gns3_server.conf and set it to true it will allow you to use the -drive option

; Allow unsafe additional command line options
allow_unsafe_options = True
g1augusto commented 2 months ago

Looks like a good catch @cristian-ciobanu I will test it tomorrow

g1augusto commented 2 months ago

EDIT: My bad, it works.

I realized I picked the wrong gns3_server.conf to add the configuration into.

Actually I didn't have at all a gns3_server.conf in the home service account directory in linux, weird...what the default values would be? the ones here? https://github.com/GNS3/gns3-server/blob/master/conf/gns3_server.conf

grossmj commented 2 months ago

Actually I didn't have at all a gns3_server.conf in the home service account directory in linux, weird...what the default values would be? the ones here? https://github.com/GNS3/gns3-server/blob/master/conf/gns3_server.conf

Yes, that file should have the default values.