summaryrefslogtreecommitdiff
path: root/source/qemu.rst
blob: e7257efaf9e57fa8bf125bc5728c138fd2fb2158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
####
QEMU
####

Exchange files with host using samba [#shared-folder]_
======================================================

When running QEMU, add the following options to the ``qemu-system-x86_64``
invocation command::

  -netdev user,smb="/path/to/shared/directory",id=mynet0 \
  -device e1000,netdev=mynet0 \

The shared directory can be mounted by a guest Linux machine like this::

  mount -t cifs //10.0.2.4/qemu <mountpoint> -o user=<user>,pass=<password>

The ``<user>`` and the ``<password>`` can be almost *anything* existing or not,
even nothing, you even can provide just ``-o user=,pass=``.

The ``-t cifs`` part might be optional if ``mount`` supports inferring file
system type.

To mount it via ``/etc/fstab`` add the following line to the file::

  //10.0.2.4/qemu <mountpoint> cifs user=<user>,pass=<password> 0 0

On Windows you can just enter the following address into explorer's address
bar, no authentication required::

  \\10.2.0.4\qemu

Overall it looks like this:

.. image:: windows-guest-explorer-exe-qemu-samba.png

.. [#shared-folder] `Shared folder between QEMU Windows guest and Linux host / stackexchange.com <https://unix.stackexchange.com/a/183609>`_