QEMU/KVM: shared file protections?

Host cannot what? I cannot parse these two sentences together.

What is this user=rtkit, group=input?

Those are user and group names in guest that correspond to qemu user and group in host. Show output of “ls -ln” both in guest and host.

Sorry, I have to change protections when I copy text from host to guest and and vice versa.

These files are made by guest and the protections are view in host. File and directory is usable in host (raija=host)
raija@localhost:~> l virtfs/
yhteensä 4
drwxrwxrwx 1 raija users 66 3. 1. 12:39 ./
drwxr-xr-x 1 raija users 2232 3. 1. 12:33 …/
-rw-rw-r-- 1 qemu qemu 16 3. 1. 12:39 file
drwxrwxr-x 1 qemu qemu 42 3. 1. 12:39 directory
raija@localhost:~>

This is how the guest sees her own (self-created) files:
vm@vm:/mnt/shared$ ls -la
yhteensä 8
drwxrwxrwx 1 vm users 66 tammi 3 12:39 .
drwxr-xr-x 3 root root 4096 tammi 3 12:18 …
-rw-rw-r-- 1 rtkit input 16 tammi 3 12:39 ‘file’
drwxrwxr-x 1 rtkit input 42 tammi 3 12:39 ‘directory’

how to upload a picture… >:(

That’s not what I asked you to show. And could you please finally start using tags [noparse]


[/noparse] around computer text.

Do you even have a guess how awkward this is for me. I can’t easily copy the text to the host <-> guest and I have to write things many times that the google translator makes valid text.And then the problem itself should remain in mind. But let’s try again, even if I have to delete the files / directories to make them again…

En jaksa enää. Olen tehnyt tätä hommaa jo 5 tuntia tänäänkin. Kun ei toimi, niin ei toimi. Antaa olla koko paska. Asennennan toiseen koneseen. Ei ole tämä kaiken tämän vaivan arvoinen ja luulen että tässä on tosiaan todellista vikaa. Asennettu ainakin 5 kertaa ja aina sama tulos.

You can capture command output to file (or better the whole command invocation + output using script command) and then copy this file to shared directory or scp this file to host or upload this file from guest to Internet directly. To name just a few options.

Anyway, you said that using security mode “none” should be enough:

You still did not explain what is wrong now, when you use security model “none”.

You can capture command output to file (or better the whole command invocation + output using script command) and then copy this file to shared directory or scp this file to host or upload this file from guest to Internet directly. To name just a few options.[/QUOTE]

Anyway, you said that using security mode "none" should be enough:

I can paste text to this forum if the text is in in my host openSUSE OS. But if it is in guest (=LinuxMint) I cannot paste it to openSUSE by copy-paste command. If I copy the text in LinuxMint (to clipboard) and change to openSUSE session there is nothing to paste (nothing in clipboard). That is one problem.
I can copy/paste text in guest LinuxMint shared file and open the file in host openSUSE by changing protection by root user (chmod 0777). But that is what I want to ger rid of. The protection shoulds be right without playing with root user.
I haven’t find combination in which both host and guest can read/write files/directories with out changing protection

About picture. What is that url I should use (when the picture is in my own directory)

|**Add an Image from Url**
|

Allowed Filetypes: jpg, jpeg, png, gif|
|URL|



/CODE]




You still did not explain what is wrong now, when you use security model “none”



I didn't find the file where to edit. The virsh edit -command uses vi editor and I cannot use it well. I didn't find help how to change is to nano? I prefer guide like: sudo nano file1 and paste to file1 xxxxxx.

OK.
I have uninstalled qemu*, libirt* with zypper and deleted linuxmint files by root as much as I dare.
I installed qemu/kvm programs with by yast2.
I installed linux mint once again with Virtual Machine Manager as user raija (not user root).
I think the configuration should be clean now.

How do I create the share directory? I have read about 5-6 document about that. Now I want to be sure that configuration is tested to work
My mother have opensuse 15.2 in use and I can test it also there if Tumbleweed is not stabble enough.

Briefly,
My SOP for purging files.
Applies to any application or situation.

  1. Identify the packages that likely are related to the application.
  2. List the contents of the packages. Unless the package is compiled on demand which is usually not the case, a package will list pre-compiled files that are simply copied to specific locations. You can list the package contents with the following command
rpm -ql *package_name* 
  1. Uninstall packages. It should be known that uninstalling will never guarantee complete removal, only uninstall “safely.”

  2. Use a “find” or similar utility to search for filenames that are likely related to your packages. I prefer the “locate” utility (part of package mlocate) because it’s much faster than most other similar utilities and highly recommend its use. You can use the package contents list you created in step 2 as a guide. Be sure to remove kernel modules which often aren’t uninstalled. Don’t overlook configuration files, especially. They’re never removed by uninstalls because it’s assumed you may eventually want to re-install and use the same custom settings, but when you’re trying to purge the system possibly in preparation for a new, default install you need to either be certain configurations are removed or over-written (with a force re-install).

  3. When you’ve removed all files related to your QEMU, KVM and Libvirt systems as much as you are able to remove them, don’t make the same mistake re-installing the individual parts using YaST Software Manager or zypper… Use the YaST Virtualization Installation module.


Regarding your Shared Directory configuration,
You should know a little about the architecture of what you’re setting up, almost all the functionality is configured in the HostOS. There is no special software I know of that runs in the Guest, only some support for the 9p protocol and a configuration. The real heavy lifting of setting up and exposing the Shared Directory is done completely in the HostOS. This means that as long as you don’t touch the virtual machine configuration files directly, everything will “just work” from the perspective of the Guest.

Everything you specify in the Shared Directory GUI… Specifying the directory to be shared, the means and mode of the sharing and the label you use to identify the shared directory are all on the HostOS… Nothing on the Guest happens on the Guest when you set up.

Then, after you’ve set up the Host correctly (likely using my Wiki article describing how to set up),
Only then you can go inside your running Guest and mount the shared directory using the instructions from my Wiki… and this is the **only **thing that is configured in the Guest. As long as you didn’t touch the virtual machine xml files, there is nothing happening outside the Guest, only the mount command in the Guest.

Am thinking that another thing you can do to ensure any old Shared Directory issues don’t carry over to a new setup is to set up a different physical directory on the HostOS to be shared (and don’t make it a subdirectory of the old directory which might inherit permissions).

TSU



Anyway, you said that using security mode "none" should be enough:

I can paste text to this forum if the text is in in my host openSUSE OS. But if it is in guest (=LinuxMint) I cannot paste it to openSUSE by copy-paste command. If I copy the text in LinuxMint (to clipboard) and change to openSUSE session there is nothing to paste (nothing in clipboard). That is one problem.
I can copy/paste text in guest LinuxMint shared file and open the file in host openSUSE by changing protection by root user (chmod 0777). But that is what I want to ger rid of. The protection shoulds be right without playing with root user.
I haven’t find combination in which both host and guest can read/write files/directories with out changing protection

About picture. What is that url I should use (when the picture is in my own directory)

|**Add an Image from Url**
|

Allowed Filetypes: jpg, jpeg, png, gif|
|URL|



/CODE]




You still did not explain what is wrong now, when you use security model “none”



I didn't find the file where to edit. The virsh edit -command uses vi editor and I cannot use it well. I didn't find help how to change is to nano? I prefer guide like: sudo nano file1 and paste to file1 xxxxxx.[/QUOTE]
To post a picture,
1. The image has to be published somewhere on the Internet. Unless the machine you're working on has a continuous Internet presence like an Internet Server, it won't work. People have uploaded pictures to pastebins (There is a https://paste.opensuse.org), a personal cloud storage like Google Drive, Dropbox, etc. Personally, I use openSUSE file storage that backs up Wikis. When you create a Wiki page like what I describe in my signature, your Wiki page will have an "image upload" link in the left navigational pane. 
2. Once the image has been uploaded to an Internet Server somewhere, make sure it has public permissions and then use the link to your image in the "Insert Image" for your Forum post.

As for nano... You only have to install nano using zypper or YaST Software Manager, and then it will be available to you.
Otherwise yes, it's a bother that vim doesn't share the same common clipboard for copying/pasting between apps.
My personal workaround whenever I get caught using vim is to upload the file to an Internet site (my preference is Github) whereupon I can retrieve it and do whatever I want.

TSU

If you run into really difficult obstacles copying text,
If all the important text fits in your screen, some people have taken a picture of the screen with their camera/phone and then uploaded the picture somewhere where you can publish the image and use the URL for the “Insert Image” in your Forum post.

TSU

Note that all of this is where you’ve gone wrong.
All this should not be necessary and should not be done when setting up your Shared Directory properly
(Use a reliable guide and reference instead of doing something on your own!)

TSU

Briefly,
My SOP for purging files.
Applies to any application or situation.
1. Identify the packages that likely are related to the application.
2. List the contents of the packages. Unless the package is compiled on demand which is usually not the case, a package will list pre-compiled files that are simply copied to specific locations. You can list the package contents with the following command

rpm -ql package_name


3. Uninstall packages. It should be known that uninstalling will never guarantee complete removal, only uninstall "safely."
4. Use a "find" or similar utility to search for filenames that are likely related to your packages. I prefer the "locate" utility (part of package mlocate) because it's much faster than most other similar utilities and highly recommend its use. You can use the package contents list you created in step 2 as a guide. Be sure to remove kernel modules which often aren't uninstalled. Don't overlook configuration files, especially. They're never removed by uninstalls because it's assumed you may eventually want to re-install and use the same custom settings, but when you're trying to purge the system possibly in preparation for a new, default install you need to either be certain configurations are removed or over-written (with a force re-install).

5. When you've removed all files related to your QEMU, KVM and Libvirt systems as much as you are able to remove them, don't make the same mistake re-installing the individual parts using YaST Software Manager or zypper... Use the YaST Virtualization Installation module.

I used zypper to uninstall packages.
When I removed files I used ‘locate’ and ‘updatedb’ commands to find files.

I have used ’ the YaST Virtualization Installation module’ every time. Once I edit the xml file with virsh edit commond to set ‘passthroug’

Be sure to remove kernel modules which often aren't uninstalled

This is new to me but in the atthcement there is list that maybe modules.
ps. I couldn’t do that. I will list it in the bottom.


Regarding your Shared Directory configuration,
You should know a little about the architecture of what you're setting up, almost all the functionality is configured in the HostOS. There is no special software I know of that runs in the Guest, only some support for the 9p protocol and a configuration. The real heavy lifting of setting up and exposing the Shared Directory is done completely in the HostOS. This means that as long as you don't touch the virtual machine configuration files directly, everything will "just work" from the perspective of the Guest.

Everything you specify in the Shared Directory GUI... Specifying the directory to be shared, the means and mode of the sharing and the label you use to identify the shared directory are all on the HostOS... Nothing on the Guest happens on the Guest when you set up.

Then, after you've set up the Host correctly (likely using my Wiki article describing how to set up),
Only then you can go inside your running Guest and mount the shared directory using the instructions from my Wiki... and this is the **only **thing that is configured in the Guest. As long as you didn't touch the virtual machine xml files, there is nothing happening outside the Guest, only the mount command in the Guest. 

I think Linux Mint 20 (guest) don’t support 9p? I can’t add a ‘file system’ to guest if I don’t install 9p packages (9p, 9pnet, 9pnet-virtio). The command gives an error and does not work. through. Maybe something else is missing?

Am thinking that another thing you can do to ensure any old Shared Directory issues don't carry over to a new setup is to set up a different physical directory on the HostOS to be shared (and don't make it a subdirectory of the old directory which might inherit permissions).

I have deleted all shared directories that I have ever used.

I would like to ask you for more help.

  • could you make for me a script of you wiki page to avoid any mistakes (google translate: Could you make a wiki from your help script that I will avoid any mistakes. lol! )

localhost:~ # zypper se kernel-
Loading repository data…
Reading installed packages…

S | Name | Summary | Type
—±---------------------------------------±--------------------------------------------------------------±-------
| kernel-debug | A Debug Version of the Kernel | package
| kernel-debug-devel | Development files necessary for building kernel modules | package
i+ | kernel-default | The Standard Kernel | package
| kernel-default-base | The Standard Kernel - base modules | package
| kernel-default-base-rebuild | Empty package to ensure rebuilding kernel-default-base in OBS | package
| kernel-default-devel | Development files necessary for building kernel modules | package
| kernel-devel | Development files needed for building kernel modules | package
| kernel-docs | Kernel Documentation | package
| kernel-docs-html | Kernel Documentation (HTML) | package
| kernel-firmware | Linux kernel firmware files | package
i | kernel-firmware-all | Compatibility metapackage for kernel firmware files | package
i | kernel-firmware-amdgpu | Kernel firmware files for AMDGPU graphics driver | package
i | kernel-firmware-ath10k | Kernel firmware files for Atheros QCA988x WiFi drivers | package
i | kernel-firmware-ath11k | Kernel firmware files for Atheros Qualcomm WiFi drivers | package
i | kernel-firmware-atheros | Kernel firmware files for Atheros wireless drivers | package
i | kernel-firmware-bluetooth | Kernel firmware files for various Bluetooth drivers | package
i | kernel-firmware-bnx2 | Kernel firmware files for Broadcom network drivers | package
i | kernel-firmware-brcm | Kernel firmware files for Broadcom wireless drivers | package
i | kernel-firmware-chelsio | Kernel firmware files for Chelsio network drivers | package
i | kernel-firmware-dpaa2 | Kernel firmware files for NXP Management Complex bus driver | package
i | kernel-firmware-i915 | Kernel firmware files for Intel i915 graphics driver | package
i | kernel-firmware-intel | Kernel firmware files for Intel-platform device drivers | package
i | kernel-firmware-iwlwifi | Kernel firmware files for Intel wireless drivers | package
i | kernel-firmware-liquidio | Kernel firmware files for Cavium LiquidIO driver | package
i | kernel-firmware-marvell | Kernel firmware files for Marvell network drivers | package
i | kernel-firmware-media | Kernel firmware files for various Video4Linux drivers | package
i | kernel-firmware-mediatek | Kernel firmware files for Mediatek network drivers | package
i | kernel-firmware-mellanox | Kernel firmware files for Mellanox Spectrum switch driver | package
i | kernel-firmware-mwifiex | Kernel firmware files for Marvell WiFi fullmac drivers | package
i | kernel-firmware-network | Kernel firmware files for various network drivers | package
i | kernel-firmware-nfp | Kernel firmware files for Netronome Flow Processor driver | package
i | kernel-firmware-nvidia | Kernel firmware files for Nvidia Tegra and graphics drivers | package
i | kernel-firmware-platform | Kernel firmware files for various platform drivers | package
i | kernel-firmware-prestera | Kernel firmware files for Marvell Prestera ASIC driver | package
i | kernel-firmware-qlogic | Kernel firmware files for QLogic network drivers | package
i | kernel-firmware-radeon | Kernel firmware files for Radeon graphics driver | package
i | kernel-firmware-realtek | Kernel firmware files for Realtek wireless drivers | package
i | kernel-firmware-serial | Kernel firmware files for various serial drivers | package
i | kernel-firmware-sound | Kernel firmware files for various sound drivers | package
i | kernel-firmware-ti | Kernel firmware files for Texas Instruments wireless drivers | package
i | kernel-firmware-ueagle | Kernel firmware files for Eagle IV USB ADSL modem driver | package
i | kernel-firmware-usb-network | Kernel firmware files for various USB WiFi / Ethernet drivers | package
| kernel-kvmsmall | The Small Developer Kernel for KVM | package
| kernel-kvmsmall-devel | Development files necessary for building kernel modules | package
| kernel-macros | RPM macros for building Kernel Module Packages | package
| kernel-obs-build | package kernel and initrd for OBS VM builds | package
| kernel-obs-qa | Basic QA tests for the kernel | package
| kernel-pae | Kernel with PAE Support | package
| kernel-pae-devel | Development files necessary for building kernel modules | package
| kernel-source | The Linux Kernel Sources | package
| kernel-source-vanilla | Vanilla Linux kernel sources with minor build fixes | package
| kernel-syms | Kernel Symbol Versions (modversions) | package
| kernel-vanilla | The Standard Kernel - without any SUSE patches | package
| kernel-vanilla-devel | Development files necessary for building kernel modules | package
| lirc-disable-kernel-rc | Disable kernel ir device handling in favor of lirc | package
i | nfs-kernel-server | Support Utilities for Kernel nfsd | package
| openafs-kernel-source | OpenAFS Kernel Module source tree | package
| patterns-devel-base-devel_kernel-32bit | Linux Kernel Development | package
| texlive-l3kernel-doc | Documentation for texlive-l3kernel | package
localhost:~ #

About 9p support.
How do I check 9p support is correct in Linux Mint 20 kernel?

ref: https://wiki.qemu.org/Documentation/9psetup

There is said:

Preparation1. Download the latest kernel code (2.6.36.rc4 or newer) from [http://www.kernel.org](http://www.kernel.org/) to build the kernel image for the guest.
2. Ensure the following 9P options are enabled in the kernel configuration.
    CONFIG_NET_9P=y
    CONFIG_NET_9P_VIRTIO=y
    CONFIG_NET_9P_DEBUG=y (Optional)
    CONFIG_9P_FS=y
    CONFIG_9P_FS_POSIX_ACL=y
    CONFIG_PCI=y
    CONFIG_VIRTIO_PCI=y
and these PCI and virtio options:
    CONFIG_PCI=y
    CONFIG_VIRTIO_PCI=y
    CONFIG_PCI_HOST_GENERIC=y (only needed for the QEMU Arm 'virt' board)

I installed an old laptop with Linux Mint 20 Cinnamon and Windows 10. I don’t need a virtual machine anymore. Annoying only when not knowing what went wrong.

I see you’ve set up an alternative solution which could also have been set up between a Guest and HostOS (Implementing a regular network share instead of a 9p Shared Directory. Only minor gotcha that would need to be resolved between Guest and HostOS is lack of name resolution by default… Would require DNS, hosts entry or use only IP addresses).

For your benefit if you decide to try to set up again, I think you missed my point about understanding the architecture of a Shared Directory relies almost entirely in the HostOS, so your focus on your Mint Guest was off base. Practically nothing needs setting up in any Guest, the defaults usually support Shared Directories without any outside configuration and only requires mounting the directory in your Guest.

TSU

I see you've set up an alternative solution which could also have been set up between a Guest and HostOS (Implementing a regular network share instead of a 9p Shared Directory. Only minor gotcha that would need to be resolved between Guest and HostOS is lack of name resolution by default... Would require DNS, hosts entry or use only IP addresses).

What does gotcha mean?

For your benefit if you decide to try to set up again, I think you missed my point about understanding the architecture of a Shared Directory relies almost entirely in the HostOS, so your focus on your Mint Guest was off base. Practically nothing needs setting up in any Guest, the defaults usually support Shared Directories without any outside configuration and only requires mounting the directory in your Guest.

I did all installation by Yast Virtual install manager (vai mikä se nyt englanniksi onkaan).
During linuxmint installation Yast said: Network is managed by Networkmanager. Netvork connection must done manually. (tai jotain sinne päin).
After successful linuxmint installation I use this commands:

In host:


zypper in libvirt* virt-manager
mkdir /home/user/virtfs
chmod -R 0777 /home/user/virtfs


Add File system with VM
Type: mapped
Mode: squash
Source Path: /home/user/virtfs
Target path: /hostshare


In guest:
mkdir /mnt/shared
mount -t 9p -o trans=virtio/hostshare /mnt/shared



This command did nowt work:
Add File system with VM
Type: mapped
Mode: squash
Source Path: /home/user/virtfs
Target path: /hostshare

these commands went through:

The 9p nedeed to install to guest.
mount -t 9p -o trans=virtio/hostshare /mnt/shared

But share didnät work.

Aha, the error is in wiki:
https://en.opensuse.org/User:Tsu2/virtfs