# Multiple Virtual Skynodes on single machine

Multiple instances of Virtual Skynode can be run when the following conditions are met:

* Each instance must use a separate storage directory. Use the `--storage` launch argument to control this
* Each instance must use a separate root filesystem image. Use the `--rootfs` launch argument to control this
* Each instance must use a separate unique IPv4 address in the same subnet. Use the `--guest-ip` launch argument to control this.
* Each instance should be configured to have a unique MAVLink system\_id after launch. See [#mav-system-id](#mav-system-id "mention") below.
* For AOS versions 4.1.11 and later, any simulation mode is configurable. For AOS version older 4.1.2, each instance's virtual FMU must be configured to use the "self-containd" simulation without Gazebo:

<figure><img src="https://3329189600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFW1Ge1p1f6WHyiYCb146%2Fuploads%2Fgit-blob-f185b733a15697f9fe336aca2b849dc2a03aab92%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Example Launch

Example launch commands for three separate virtual skynode instances:

<pre class="language-sh"><code class="lang-sh"><strong># Copy the root filesystem twice
</strong>cp rootfs rootfs2
cp rootfs rootfs3
mv rootfs rootfs1
</code></pre>

Launch the first instance:

```
virtual-skynode run --rootfs rootfs-1.qcow2 --storage ./storage1 --guest-ip 10.41.200.2
```

Launch the second instance:

```
virtual-skynode run --rootfs rootfs-2.qcow2 --storage ./storage2 --guest-ip 10.41.200.3
```

Launch the third instance:

```
virtual-skynode run --rootfs rootfs-3.qcow2 --storage ./storage3 --guest-ip 10.41.200.4
```

## Mav System ID

In case one wants to simulate a specific vehicle ID or run multiple skynodes in parallel, the vehicle ID can be set via the app's web UI.

{% hint style="info" %}
This feature is available since virtual AOS 4.1.12 with virtual FMU app 1.4.3. For

* SIH and
* Simulation-Gazebo

it works our of the box. For Airsim simulation, special configuration is required. Contact Auterion for instructions.
{% endhint %}

<figure><img src="https://3329189600-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFW1Ge1p1f6WHyiYCb146%2Fuploads%2Fgit-blob-b097ed5f2844e5c5ede9aeb236b4a2d326bf2593%2Fimage.png?alt=media" alt=""><figcaption><p>Instance ID for virtual FMU</p></figcaption></figure>

After modifying the instance ID, reload your simulation. For multiple skynodes, in order to avoid conflicts by the same ID on various virtual devices, it is recommened to start the different virtual devices separately the first time and confiure them propperly, before running all together.

For Gazebo simulation, ensure to the the initial position properly. Otherwise your vehicles will be stacked.

## Caveats

Each instance of Virtual Skynode will consume CPU, RAM and disk space. Running multiple Virtual Skynode instances is therefore only viable on more powerful machines.
