Hide Forgot
Add a support to create symbolic links (mklink) and be able to follow them.
https://github.com/virtio-win/kvm-guest-drivers-windows/pull/538
Hi Gal, I try to test this new support with following steps and pkg, but hit flowing issue, could you please help to confirm whether my steps are valid? Please feel free to correct me, thanks in advance. pkg: virtio-win-prewhql-0.1-194.iso qemu-kvm-5.2.0-4.module+el8.4.0+9676+589043b9.x86_64 seabios-bin-1.14.0-1.module+el8.4.0+8855+a9e237a9.noarch here are my steps: 1. Create a shared directory for testing on the host. e.g: # mkdir -p /tmp/virtiofs_test 2. Run the virtiofsd daemon on the host. e.g: # /usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu -o source=/tmp/virtiofs_test -o cache=always 3. Boot a guest on the host. e.g: # /usr/libexec/qemu-kvm ... -smp 2 \ -m 4G \ -object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \ -numa node,memdev=mem \ -chardev socket,id=char0,path=/tmp/vhostqemu \ -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs \ ... 4. Log into guest then mount the file system for windows guest : 1) make sure virtio-fs driver is installed 2) install WINFSP in guest.(download winfsp installe: http://www.secfs.net/winfsp/rel/ ) 3)Open virtio-win driver folder and run virtiofs.exe virtiofs.exe -D - c:\virtiofs-log.txt -d -1 4)In computer we will have a new Z: drive 5.copy a folder(not blank) eg: tools to Z: 6.access Z: and send command Z:\ mklink /D test tools actual result: after step 6, error message'Cannot create a file when that file already exists .' Addtional info: if mklink a file on step 6 it will success. eg: Z:\ mklink test existingfile Thanks Menghuan
Change it to ASSIGNED status for 'Fail to create a symbolic link to a directory'
Gal hi, I know this bug is opened for symbolic links, but I also want to confirm if it supports creating a hard link or a directory junction? Below is my testing in virtiofs and ntfs. Z:\>mklink /h f1-hard-link f1 The request is not supported. Z:\>mklink /j f1-link3 f1 Local volumes are required to complete the operation. C:\>mklink /h f1-hard-link f1 Hardlink created for f1-hard-link <<===>> f1 C:\>mklink /j f1-link3 f1 Junction created for f1-link3 <<===>> f1 Thanks, Xiaoling
(In reply to xiagao from comment #16) > Gal hi, > I know this bug is opened for symbolic links, but I also want to confirm if > it supports creating a hard link or a directory junction? > Below is my testing in virtiofs and ntfs. > > Z:\>mklink /h f1-hard-link f1 > The request is not supported. > > Z:\>mklink /j f1-link3 f1 > Local volumes are required to complete the operation. > > > C:\>mklink /h f1-hard-link f1 > Hardlink created for f1-hard-link <<===>> f1 > > C:\>mklink /j f1-link3 f1 > Junction created for f1-link3 <<===>> f1 > > Thanks, > Xiaoling It is not supported for now and will probably only be added if someone will request these. BTW: I don't even known what "Directory Junction" is... ;-)
Fix for the symbolic link to a directory: https://github.com/virtio-win/kvm-guest-drivers-windows/pull/566
fix included into build 198 https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1573292
Test with build 198. Can create symbolic link with mklink command,but it's type is not correct. The type is 'file' type for folder link,so can't open it.(see attachment) steps: 1.create symbolic link for a file on shared volume(z:) Z:\>mklink file-link file.txt symbolic link created for file-link <<===>> file.txt Z:\>mklink /d folder-link folder symbolic link created for folder-link <<===>> folder 2.create symbolic link on ntfs volume(c:) Z:\>c: C:\>mklink file-link file.txt symbolic link created for file-link <<===>> file.txt C:\>mklink /d folder-link folder symbolic link created for folder-link <<===>> folder 3.check the symbolic link. C:\>dir Volume in drive C is Windows Volume Serial Number is 98C9-A511 Directory of C:\ 04/14/2021 01:41 AM <SYMLINK> file-link [file.txt] 04/14/2021 01:41 AM 0 file.txt 04/14/2021 01:40 AM <DIR> folder 04/14/2021 01:41 AM <SYMLINKD> folder-link [folder] C:\>z: Z:\>dir Volume in drive Z is myfs_11 Volume Serial Number is 0000-0000 Directory of Z:\ 01/01/1970 08:00 AM <DIR> . 01/01/1970 08:00 AM <DIR> .. 04/14/2021 01:39 PM 0 file-link 04/14/2021 01:50 PM 469 file.txt 04/14/2021 01:39 PM <DIR> folder 04/14/2021 01:40 PM 0 folder-link 3 File(s) 475 bytes 3 Dir(s) 462,578,851,840 bytes free
Created attachment 1771745 [details] picture of symbolic link on shared volume
Needinfo Gal in case missing comment 21.
The symbolic link issue was resolved, so moving to POST.
Still hit issue of comment21 on virtio-win-prewhql-199. Z:\>mklink test1-link test1 symbolic link created for test1-link <<===>> test1 Z:\>mklink test2-link test2.txt symbolic link created for test2-link <<===>> test2.txt Z:\>mklink /d test1-link-d test1 symbolic link created for test1-link-d <<===>> test1 Z:\>mklink /d test2-link-d test2.txt symbolic link created for test2-link-d <<===>> test2.txt Z:\> Z:\> Z:\> Z:\>dir Volume in drive Z is myfs_11 Volume Serial Number is 0000-0000 Directory of Z:\ 01/01/1970 08:00 AM <DIR> . 01/01/1970 08:00 AM <DIR> .. 05/17/2021 09:21 AM <DIR> test1 05/17/2021 09:30 AM 0 test1-link 05/17/2021 09:31 AM 0 test1-link-d 05/17/2021 09:30 AM 0 test2-link 05/17/2021 09:31 AM 0 test2-link-d 05/17/2021 09:29 AM 0 test2.txt 10 File(s) 276,324 bytes 5 Dir(s) 443,076,751,360 bytes free
(In reply to xiagao from comment #25) > Still hit issue of comment21 on virtio-win-prewhql-199. > Z:\>mklink test1-link test1 > symbolic link created for test1-link <<===>> test1 > > Z:\>mklink test2-link test2.txt > symbolic link created for test2-link <<===>> test2.txt > > Z:\>mklink /d test1-link-d test1 > symbolic link created for test1-link-d <<===>> test1 > > Z:\>mklink /d test2-link-d test2.txt > symbolic link created for test2-link-d <<===>> test2.txt > > Z:\> > Z:\> > Z:\> > Z:\>dir > Volume in drive Z is myfs_11 > Volume Serial Number is 0000-0000 > > Directory of Z:\ > > 01/01/1970 08:00 AM <DIR> . > 01/01/1970 08:00 AM <DIR> .. > 05/17/2021 09:21 AM <DIR> test1 > 05/17/2021 09:30 AM 0 test1-link > 05/17/2021 09:31 AM 0 test1-link-d > 05/17/2021 09:30 AM 0 test2-link > 05/17/2021 09:31 AM 0 test2-link-d > 05/17/2021 09:29 AM 0 test2.txt > 10 File(s) 276,324 bytes > 5 Dir(s) 443,076,751,360 bytes free It seem to be a limitation (or a bug?) of WinFSP. Can you please check if the Windows follows the symbolic links and ignore what "dir" shows you? For example: C:\>echo 1 > 1.txt C:\>mklink 1-link.txt 1.txt symbolic link created for 1-link.txt <<===>> 1.txt C:\>type 1-link.txt 1
(In reply to Gal Hammer from comment #27) > (In reply to xiagao from comment #25) > > Still hit issue of comment21 on virtio-win-prewhql-199. > > Z:\>mklink test1-link test1 > > symbolic link created for test1-link <<===>> test1 > > > > Z:\>mklink test2-link test2.txt > > symbolic link created for test2-link <<===>> test2.txt > > > > Z:\>mklink /d test1-link-d test1 > > symbolic link created for test1-link-d <<===>> test1 > > > > Z:\>mklink /d test2-link-d test2.txt > > symbolic link created for test2-link-d <<===>> test2.txt > > > > Z:\> > > Z:\> > > Z:\> > > Z:\>dir > > Volume in drive Z is myfs_11 > > Volume Serial Number is 0000-0000 > > > > Directory of Z:\ > > > > 01/01/1970 08:00 AM <DIR> . > > 01/01/1970 08:00 AM <DIR> .. > > 05/17/2021 09:21 AM <DIR> test1 > > 05/17/2021 09:30 AM 0 test1-link > > 05/17/2021 09:31 AM 0 test1-link-d > > 05/17/2021 09:30 AM 0 test2-link > > 05/17/2021 09:31 AM 0 test2-link-d > > 05/17/2021 09:29 AM 0 test2.txt > > 10 File(s) 276,324 bytes > > 5 Dir(s) 443,076,751,360 bytes free > > It seem to be a limitation (or a bug?) of WinFSP. Can you please check if > the Windows follows the symbolic links and ignore what "dir" shows you? > > For example: > > C:\>echo 1 > 1.txt > > C:\>mklink 1-link.txt 1.txt > symbolic link created for 1-link.txt <<===>> 1.txt > > C:\>type 1-link.txt > 1 Yes, virtio-fs mounted volume has the same behavior, the detailed info is below. Z:\>echo 1 > 1.txt Z:\>mklink 1-link.txt 1.txt symbolic link created for 1-link.txt <<===>> 1.txt Z:\>type 1-link.txt 1 Z:\>dir Volume in drive Z is myfs_11 Volume Serial Number is 0000-0000 Directory of Z:\ 01/01/1970 08:00 AM <DIR> . 01/01/1970 08:00 AM <DIR> .. 05/27/2021 08:57 AM 0 1-link.txt 05/27/2021 08:57 AM 4 1.txt
(In reply to Gal Hammer from comment #27) > (In reply to xiagao from comment #25) > > Still hit issue of comment21 on virtio-win-prewhql-199. > > Z:\>mklink test1-link test1 > > symbolic link created for test1-link <<===>> test1 > > > > Z:\>mklink test2-link test2.txt > > symbolic link created for test2-link <<===>> test2.txt > > > > Z:\>mklink /d test1-link-d test1 > > symbolic link created for test1-link-d <<===>> test1 > > > > Z:\>mklink /d test2-link-d test2.txt > > symbolic link created for test2-link-d <<===>> test2.txt > > > > Z:\> > > Z:\> > > Z:\> > > Z:\>dir > > Volume in drive Z is myfs_11 > > Volume Serial Number is 0000-0000 > > > > Directory of Z:\ > > > > 01/01/1970 08:00 AM <DIR> . > > 01/01/1970 08:00 AM <DIR> .. > > 05/17/2021 09:21 AM <DIR> test1 > > 05/17/2021 09:30 AM 0 test1-link > > 05/17/2021 09:31 AM 0 test1-link-d > > 05/17/2021 09:30 AM 0 test2-link > > 05/17/2021 09:31 AM 0 test2-link-d > > 05/17/2021 09:29 AM 0 test2.txt > > 10 File(s) 276,324 bytes > > 5 Dir(s) 443,076,751,360 bytes free > > It seem to be a limitation (or a bug?) of WinFSP. Can you please check if > the Windows follows the symbolic links and ignore what "dir" shows you? Hi Gal, The symbolic links works with virtio-win-prewhql-199, can we verify this bug? And about "ignore what 'dir' show",could you handle it(where to note this behavior)? Thanks, Xiaoling > > For example: > > C:\>echo 1 > 1.txt > > C:\>mklink 1-link.txt 1.txt > symbolic link created for 1-link.txt <<===>> 1.txt > > C:\>type 1-link.txt > 1
Hi Gal, symbolic link only works for file not folder,for symbolic folder can't show the file in symbolic folder. Do you want to support it in this release? Or I file two new bug to track folder issue and dir show issue? Z:\>md test_folder2 Z:\>echo aaa > test_folder2\a Z:\>mklink /d test_folder2-link test_folder2 symbolic link created for test_folder2-link <<===>> test_folder2 Z:\>dir 06/08/2021 05:25 PM <DIR> test_folder2 06/08/2021 05:31 PM 0 test_folder2-link Z:\test_folder2>dir Volume in drive Z is myfs_11 Volume Serial Number is 0000-0000 Directory of Z:\test_folder2 01/01/1970 08:00 AM <DIR> . 01/01/1970 08:00 AM <DIR> .. 06/08/2021 05:31 PM 6 a 1 File(s) 6 bytes 2 Dir(s) 246,249,897,984 bytes free Z:\test_folder2-link>dir Volume in drive Z is myfs_11 Volume Serial Number is 0000-0000 Directory of Z:\ ==========================>should be Z:\test_folder2 06/08/2021 05:31 PM 0 test_folder2-link 1 File(s) 0 bytes 0 Dir(s) 246,249,897,984 bytes free ==========================>should have file 'a'
The results in comment #32 were based on a version which didn't include the symbolic links to directories fix. However another bug was found in the new version (type test_folder2-link\a) so another patch was posted (https://github.com/virtio-win/kvm-guest-drivers-windows/pull/587).
Test virtio-win-prewhql-202, type folder2-link\a.txt still failed. guest: win2019 Z:\>md folder2 Z:\>echo test > folder2\a.txt Z:\>type folder2\a.txt test Z:\>mklink /d folder2-link folder2 symbolic link created for folder2-link <<===>> folder2 Z:\>type folder2-link\a.txt The system cannot find the file specified.
The fix included into build 202 https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1634715
According to comment 34, reassign this bz.
(In reply to xiagao from comment #34) > Test virtio-win-prewhql-202, type folder2-link\a.txt still failed. > guest: win2019 > > > Z:\>md folder2 > > Z:\>echo test > folder2\a.txt > > Z:\>type folder2\a.txt > test > > Z:\>mklink /d folder2-link folder2 > symbolic link created for folder2-link <<===>> folder2 > > Z:\>type folder2-link\a.txt > The system cannot find the file specified. - Test with win2012 guest, hit the same issue with win2019 - Test win2016 guest with virtio-win-prewhql-202 version,when execute "Z:\>type folder2-link\a.txt" ,get another wrong error info below. > Z:\>type folder2-link\a.txt > The filename, directory name, or volume label syntax is incorrect.
https://github.com/virtio-win/kvm-guest-drivers-windows/pull/589
Test virtio-win-prewhql-203, hit the following error. Z:\>md folder Z:\>echo test > folder\a.txt Z:\>mklink /d folder-link folder symbolic link created for folder-link <<===>> folder Z:\>type folder\a.txt test Z:\>type folder-link\a.txt The filename, directory name, or volume label syntax is incorrect. ===================>error info Z:\>dir folder-link Volume in drive Z is myfs Volume Serial Number is 0000-0000 Directory of Z:\ 07/02/2021 05:48 PM 0 folder-link 1 File(s) 0 bytes 0 Dir(s) 101,799,694,336 bytes free
virtio-win-prewhql-204 still has this issue.
https://github.com/virtio-win/kvm-guest-drivers-windows/pull/604 Maybe this time: Z:\>md folder Z:\>echo test > folder\a.txt Z:\>mklink /d folder-link folder symbolic link created for folder-link <<===>> folder Z:\>type folder\a.txt test Z:\>type folder-link\a.txt test
Test pass with virtio-win-prewhql-205 windows os: Win10-32/64(21h1),win2012r2 Detailed steps: Z:\>md folder Z:\>echo test > folder\a.txt Z:\>mklink /d folder-link folder symbolic link created for folder-link <<===>> folder Z:\>type folder-link\a.txt test Z:\> Z:\>echo test > b.txt Z:\>mklink b-link b.txt symbolic link created for b-link <<===>> b.txt Z:\>type b-link test So change status to verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virtio-win bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2021:4341