Code Monkey home page Code Monkey logo

Comments (4)

glennmatthews avatar glennmatthews commented on June 24, 2024

Hi! When last I looked into the OVF files exported from VirtualBox, the XML that you're referencing above was encapsulated in the VirtualBox-specific vbox:Machine section in the XML; I'm not sure if that's changed in newer VirtualBox versions, but in any case despite their use of the ovf XML namespace, the above elements are not part of the OVF standard but are in fact VirtualBox-specific extensions.

I've tried to keep COT agnostic of the various vendor-specific extensions of the specification so far, but if you can specify the exact functionality that you'd like to have here for processing a VirtualBox-specific OVF, I'm willing to consider adding it - i.e., what information would you like to appear in cot info? What would be the arguments and behavior you'd like to see for a new cot edit-vbox-port-forwarding (?) command?

Thanks!

from cot.

HeroCC avatar HeroCC commented on June 24, 2024

That would be great! Or if you're uncomfortable with adding non-generic utilities to COT, maybe a plugin / addon or a separate python program that uses the cot API? I'm no expert when it comes to this, whatever you're most happy with.

You're right, I checked, both 1.0 and 2.0 exports have the forward inside the vbox:Machine namespace. If you were to add the functionality, in info I'd like to see the name, host port and guest port, type (TCP or UDP), and if they are specified, the IP bindings (guest and host). For the edit command, I'd like to be able to edit all of those fields, as well as add and delete. Essentially, a replication of the functionality in the GUI. This is only available when using the NAT type network.
image

Here's my attempt at syntax, though I'm in no way married to this exact format if you have any other suggestions:

$ cot help edit-vbox-port-forwarding
usage:
  cot edit-vbox-port-forwarding --help

Edit VirtualBox Port Forwarding Rules

positional arguments:
  PACKAGE               OVF descriptor or OVA file to edit

general options:
  -h, --help            Show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Name/path of new OVF/OVA package to create instead of updating the existing OVF

  -n 'Rule Name', --rule 'Rule Name'
                        Select which rule we will be modifying.
  -d, --delete
                        Delete the specified rule. Ignores other args
  -p (TCP/UDP), --protocol
                        Specify which protocol to forward
  -gp (1...65300), --guest-port
                        Specify which port to expose from the guest
  -gip (IP_ADDRESS), --guest-ip
                        Specify which IP to bind from the guest
  -hp (1...65300), --host-port
                        Specify which port to expose on the host
  -hip (IP_ADDRESS), --host-ip
                        Which IP to bind to on the host
  --delete-all-rules
                        Delete all forwarding rules

from cot.

HeroCC avatar HeroCC commented on June 24, 2024

If it helps at all, here's what it looks like when exported as OVF v2, with the hostip and guestip set.

        <Network>
          <Adapter slot="0" enabled="true" MACAddress="<snip>" type="82540EM">
            <DisabledModes>
              <BridgedInterface name="<snip>"/>
              <InternalNetwork name="intnet"/>
              <NATNetwork name="NatNetwork"/>
            </DisabledModes>
            <NAT>
              <Forwarding name="Rule 1" proto="1" hostip="0.0.0.0" hostport="9080" guestip="1.1.1.1" guestport="9080"/>
            </NAT>
          </Adapter>
        </Network>

from cot.

HeroCC avatar HeroCC commented on June 24, 2024

I ended up finding a way around this -- I ran a docker container with virtualbox, imported the file, used VBoxManage to tweak the vm, and exported it. Feel free to close this ticket if you're not interested in implementing this anymore, thank your for considering it in the first place!

from cot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.