How to reset Host Only Adapter Networking for Oracle VirtualBox VM Manager

45

Blindly using vboxnet0 as your interface name will not work for everyone, or even most people.

  1. Use ifconfig to get a list of your network adapters.

  2. On my machine it was the ethernet I wanted to restart, but yours may be wlan. The ethernet interface on my machine was enp0s3.

  3. Use the ifconfig commands @encgoo mentioned. sudo ifconfig enp0s3 down && sudo ifconfig enp0s3 up. Replace enp0s3 with your own interface name of course.

Share:
45

Related videos on Youtube

holyhope
Author by

holyhope

Updated on September 18, 2022

Comments

  • holyhope
    holyhope over 1 year

    I'm developing in C and I need ask an info about callback use.

    Suppose I defined 3 callback with 3 different type in input for callback, example:

    typedef void (*CB_1) (const struct paramType_1 *p);
    typedef void (*CB_2) (const struct paramType_2 *p);
    typedef void (*CB_3) (const struct paramType_3 *p);
    

    Ok I have 3 array of callback, each for type of callback:

    static CB_1         CB1List[10] ;
    static CB_2         CB2List[10] ;
    static CB_3         CB3List[10] ;
    

    So I have defined 3 list of callback to call (in maybe different situation) and each list is of specific type of callback (CB_1 ,CB_2 or CB_3) that have a specific callback param (paramType_1,paramType_2 or paramType_3).

    Suppose now that I need to perform an operation that is IDENTICAL for each callback ... I must copy paste 3 time the function due different specific param... suppose for example that i need to add a callback to array I need this;:

       static void CBAdd_1(CB_1 _cb) {   
          CB1List[i] = _cb
        }
       static void CBAdd_2(CB_2 _cb) {   
          CB2List[i] = _cb
        }
        static void CBAdd_3(CB_3 _cb) {  
          CB3List[i] = _cb
        }
    

    what is a correct way to use a generic funcion "void CBAdd" for not replicate three time the function for the three callback? maybe using (void*) parameters or other?

    thanks

    • cleblanc
      cleblanc over 5 years
      I would probably use void * parameters I think.
  • holyhope
    holyhope over 5 years
    Goodmorning! Thanks for your answer! Now I test it!