I wanna share /mnt so I can download stuff to my hard drives

  • zelifcam@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    16 days ago

    You can use a local folder as storage that’s mounted in the VM. Something like this snippet I pulled.

    https://libvirt.org/kbase/virtiofs.html


    To create a shared folder in Virt Manager that links to a local folder on your filesystem, follow these steps:

    Step 1: Open Virt Manager and Select Your Virtual Machine

    1. Open Virt Manager.
    2. Select the virtual machine you want to add the shared folder to, but do not start it.
    3. Click on the “Open” button to access the virtual machine’s settings.

    Step 2: Add a New Hardware Device

    1. In the virtual machine’s details window, go to the “Add Hardware” button, usually located at the bottom left.
    2. In the “Add Hardware” dialog, select “Filesystem” from the list.

    Step 3: Configure the Shared Folder

    1. In the “Filesystem” settings:
      • Mode: Choose virtio for best performance.
      • Driver: Leave this as default (virtiofs).
      • Source Path: Browse to the local folder you want to share with the virtual machine.
      • Target Path: Specify the mount point within the guest (for example, /mnt/shared).
    2. Click “Finish” to add the shared folder.

    Step 4: Start the Virtual Machine

    1. After setting up the shared folder, start the virtual machine.

    Step 5: Mount the Shared Folder in the Guest OS

    1. Linux Guest:

      • You need to mount the shared folder manually. For example:
        sudo mount -t virtiofs shared_folder /mnt/shared
        
      • Ensure that shared_folder is the name you used for the Target Path.
    2. Windows Guest:

      • Virtiofs support in Windows is not as straightforward as in Linux. If you’re using a Linux-based guest, the above should work seamlessly. For Windows, you might need to install additional drivers or use alternative methods like Samba shares.

    Step 6: Access the Shared Folder

    Once mounted, you can access the shared folder as you would any other directory within your guest OS.

    This configuration allows your virtual machine to interact with a folder on your host system, making it easier to share files between the host and guest environments.