2015-01-20 00:50:52 +01:00
|
|
|
A 9p filesystem is supported by the emulator, using a virtio transport. Using
|
2023-01-06 16:13:51 +01:00
|
|
|
it, files can be exchanged with the guest OS, see `create_file` and `read_file`
|
|
|
|
in [`starter.js`](https://github.com/copy/v86/blob/master/src/browser/starter.js).
|
|
|
|
It can be enabled by passing the following options to `V86`:
|
2015-01-20 00:50:52 +01:00
|
|
|
|
|
|
|
```javascript
|
2017-09-10 04:31:24 +02:00
|
|
|
filesystem: {
|
|
|
|
basefs: "../9p/fs.json",
|
|
|
|
baseurl: "../9p/base/",
|
2015-01-20 00:50:52 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Here, `basefs` is a json file created using
|
|
|
|
[fs2json](https://github.com/copy/fs2json). The base url is the prefix of a url
|
|
|
|
from which the files are available. For instance, if the 9p filesystem has a
|
|
|
|
file `/bin/sh`, that file must be accessible from
|
|
|
|
`http://localhost/9p/base/bin/sh`. If `basefs` and `baseurl` are omitted, an
|
|
|
|
empty 9p filesystem is created.
|
|
|
|
|
|
|
|
The `mount_tag` of the 9p device is `host9p`. In order to mount it in the
|
|
|
|
guest, use:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
mount -t 9p host9p /mnt/9p/
|
|
|
|
```
|