virt-v2v 1.38 fails to convert .vmx VM: setfiles ... Multiple same specifications for /.*.
Hello. I'm trying to convert VMware based virtual machines (CentOS 7.2) and output them into oVirt. virt-v2v fails with following error: setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. File `file_contexts' looks same like in recent CentOS 7.4. My conversion server is Fedora 28 (Rawhide), since it contains virt-v2v 1.38. virt-v2v -v -x output is attached. Настоящее сообщение, направленное по электронной почте, и любые вложения - это корреспонденция, содержащая информацию, доступ к которой ограничен в соответствии с законодательством Российской Федерации и которая предназначена только для использования уполномоченными АО «НСПК» получателями сообщения (уполномоченными лицами). Если Вы не являетесь уполномоченным лицом или Вам не известно, являетесь ли Вы таким уполномоченным получателем сообщения от АО «НСПК», то уведомляем, что любое раскрытие, распространение или копирование этого сообщения влечет за собой установленную законом ответственность. Если Вы не являетесь уполномоченным получателем сообщения, просим Вас незамедлительно информировать об этом отправителя и удалить полученное сообщение из системы. This e-mail message together with any attachments hereto contains confidential information and is intended for recipients authorized by NSPK only. Any disclosure, distribution or copying of this message entails liability established by law. If you are not an authorized recipient, please immediately inform the sender and delete this message from your information system.
On Mon, Mar 05, 2018 at 02:03:17PM +0000, Зиновик Игорь Анатольевич wrote:
Hello.
I'm trying to convert VMware based virtual machines (CentOS 7.2) and output them into oVirt. virt-v2v fails with following error: setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*.
File `file_contexts' looks same like in recent CentOS 7.4. My conversion server is Fedora 28 (Rawhide), since it contains virt-v2v 1.38.
This has got to be a bug of some kind in the SELinux ‘setfiles’ program. What happens if you run these commands (which should be safe to run because they only operate on a throw-away overlay): qemu-img create -f qcow2 throwaway.qcow2 /mnt/knp1-vm-otp02/knp1-vm-otp02.vmdk virt-customize --selinux-relabel -a throwaway.qcow2 rm throwaway.qcow2 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Hello, Richard.
-----Original Message----- From: Richard W.M. Jones [mailto:rjones@redhat.com] Sent: Monday, March 5, 2018 8:42 PM To: Зиновик Игорь Анатольевич <ZinovikIA@nspk.ru> Cc: libguestfs@redhat.com Subject: Re: [Libguestfs] virt-v2v 1.38 fails to convert .vmx VM: setfiles ... Multiple same specifications for /.*.
Hello.
I'm trying to convert VMware based virtual machines (CentOS 7.2) and output
On Mon, Mar 05, 2018 at 02:03:17PM +0000, Зиновик Игорь Анатольевич wrote: them into oVirt.
virt-v2v fails with following error: setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*.
File `file_contexts' looks same like in recent CentOS 7.4. My conversion server is Fedora 28 (Rawhide), since it contains virt-v2v 1.38.
This has got to be a bug of some kind in the SELinux ‘setfiles’ program.
Fedora rawhide has policycoreutils-2.7-11.fc28.x86_64 (setfiles is shipped inside that rpm package).
What happens if you run these commands (which should be safe to run because they only operate on a throw-away overlay):
qemu-img create -f qcow2 throwaway.qcow2 /mnt/knp1-vm-otp02/knp1-vm- otp02.vmdk
Seems that qemu-img 2.11 (which I have on my fedora rawhide) does not support such format of invocation. VM have two disks (/boot and LVM partitioned one). I converted both disks to .qcow2 format and executed virt-customize on them: # qemu-img convert -f vmdk -O qcow2 /mnt/knp1-vm-otp02/knp1-vm-otp02.vmdk ta.qcow2 # qemu-img convert -f vmdk -O qcow2 /mnt/knp1-vm-otp02/knp1-vm-otp02_1.vmdk ta1.qcow2 # virt-customize --colours -v -x --selinux-relabel -a ta.qcow2 -a ta1.qcow2
virt-customize --selinux-relabel -a throwaway.qcow2 rm throwaway.qcow2
Here is a most interesting snippet from `virt-customize -v -x --selinux-relabel -a ta.qcow2 -a ta1.qcow2' output: ... many lines skipped ... libguestfs: trace: aug_ls "/files/etc/selinux/config" guestfsd: <= aug_ls (0x1c) request length 72 bytes libguestfs: trace: aug_ls = ["/files/etc/selinux/config/#comment[1]", "/files/etc/selinux/config/#comment[2]", "/files/etc/selinux/config/#comment[3]", "/files/etc/selinux/config/#comment[4]", "/files/etc/selinux/config/#comment[5]", iles/etc/selinux/config/#comment[6]", "/files/etc/selinux/config/#comment[7]", "/files/etc/selinux/config/#comment[8]", "/files/etc/selinux/config/#comment[9]", "/files/etc/selinux/config/SELINUX[1]", "/files/etc/selinux/config/SELINU]"] libguestfs: trace: aug_close guestfsd: => aug_ls (0x1c) took 0.00 secs guestfsd: <= aug_close (0x1a) request length 40 bytes libguestfs: trace: aug_close = 0 libguestfs: trace: grep "vdagentd.\pid" "/etc/selinux/targeted/contexts/files/file_contexts" "fixed:true" guestfsd: => aug_close (0x1a) took 0.14 secs guestfsd: <= grep (0x97) request length 132 bytes commandrvf: stdout=y stderr=y flags=0x20004 commandrvf: grep -F vdagentd.\pid libguestfs: trace: grep = [] libguestfs: trace: selinux_relabel "/etc/selinux/targeted/contexts/files/file_contexts" "/" "force:true" guestfsd: => grep (0x97) took 0.12 secs guestfsd: <= selinux_relabel (0x1d3) request length 108 bytes commandrvf: stdout=n stderr=y flags=0x0 commandrvf: setfiles -m usage: setfiles [-diIDlmnpqvFW] [-e excludedir] [-r alt_root_path] spec_file pathname... usage: setfiles [-diIDlmnpqvFW] [-e excludedir] [-r alt_root_path] spec_file -f filename usage: setfiles -s [-diIDlmnpqvFW] spec_file usage: setfiles -c policyfile spec_file commandrvf: stdout=n stderr=y flags=0x0 commandrvf: setfiles -F -e /sysroot/dev -e /sysroot/proc -e /sysroot/selinux -e /sysroot/sys -m -r /sysroot -v /sysroot/etc/selinux/targeted/contexts/files/file_contexts /sysroot/ Can't stat exclude path "/sysroot/selinux", No such file or directory - ignoring. setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument guestfsd: error: Can't stat exclude path "/sysroot/selinux", No such file or directory - ignoring. setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument libguestfs: trace: selinux_relabel = -1 (error) virt-customize: error: libguestfs error: selinux_relabel: Can't stat exclude path "/sysroot/selinux", No such file or directory - ignoring. setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument libguestfs: trace: close libguestfs: closing guestfs handle 0x1cf9d90 (state 2) libguestfs: trace: internal_autosync guestfsd: => selinux_relabel (0x1d3) took 3.49 secs guestfsd: <= internal_autosync (0x11a) request length 40 bytes Настоящее сообщение, направленное по электронной почте, и любые вложения - это корреспонденция, содержащая информацию, доступ к которой ограничен в соответствии с законодательством Российской Федерации и которая предназначена только для использования уполномоченными АО «НСПК» получателями сообщения (уполномоченными лицами). Если Вы не являетесь уполномоченным лицом или Вам не известно, являетесь ли Вы таким уполномоченным получателем сообщения от АО «НСПК», то уведомляем, что любое раскрытие, распространение или копирование этого сообщения влечет за собой установленную законом ответственность. Если Вы не являетесь уполномоченным получателем сообщения, просим Вас незамедлительно информировать об этом отправителя и удалить полученное сообщение из системы. This e-mail message together with any attachments hereto contains confidential information and is intended for recipients authorized by NSPK only. Any disclosure, distribution or copying of this message entails liability established by law. If you are not an authorized recipient, please immediately inform the sender and delete this message from your information system.
On Tue, Mar 06, 2018 at 08:40:51AM +0000, Зиновик Игорь Анатольевич wrote:
What happens if you run these commands (which should be safe to run because they only operate on a throw-away overlay):
qemu-img create -f qcow2 throwaway.qcow2 /mnt/knp1-vm-otp02/knp1-vm- otp02.vmdk
I missed out the -b flag: qemu-img create -f qcow2 throwaway.qcow2 -b /mnt/knp1-vm-otp02/knp1-vm-otp02.vmdk anyway ...
setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument guestfsd: error: Can't stat exclude path "/sysroot/selinux", No such file or directory - ignoring. setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument libguestfs: trace: selinux_relabel = -1 (error)
I have policycoreutils-2.7-14.fc29.x86_64 but I wasn't able to reproduce this using: virt-builder rhel-7.4 virt-customize -a rhel-7.4.img --selinux-relabel Can you send me the /etc/selinux/targeted/contexts/files/file_contexts file from within the guest? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
-----Original Message----- From: Richard W.M. Jones [mailto:rjones@redhat.com] Sent: Tuesday, March 6, 2018 11:49 AM To: Зиновик Игорь Анатольевич <ZinovikIA@nspk.ru> Cc: libguestfs@redhat.com Subject: Re: [Libguestfs] virt-v2v 1.38 fails to convert .vmx VM: setfiles ... Multiple same specifications for /.*.
On Tue, Mar 06, 2018 at 08:40:51AM +0000, Зиновик Игорь Анатольевич wrote:
What happens if you run these commands (which should be safe to run because they only operate on a throw-away overlay):
qemu-img create -f qcow2 throwaway.qcow2 /mnt/knp1-vm-otp02/knp1-vm- otp02.vmdk
I missed out the -b flag:
qemu-img create -f qcow2 throwaway.qcow2 -b /mnt/knp1-vm-otp02/knp1- vm-otp02.vmdk
anyway ...
setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument guestfsd: error: Can't stat exclude path "/sysroot/selinux", No such file or directory - ignoring. setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*. /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Invalid argument libguestfs: trace: selinux_relabel = -1 (error)
I have policycoreutils-2.7-14.fc29.x86_64 but I wasn't able to reproduce this using:
virt-builder rhel-7.4 virt-customize -a rhel-7.4.img --selinux-relabel
Can you send me the /etc/selinux/targeted/contexts/files/file_contexts file from within the guest?
See attached file. Настоящее сообщение, направленное по электронной почте, и любые вложения - это корреспонденция, содержащая информацию, доступ к которой ограничен в соответствии с законодательством Российской Федерации и которая предназначена только для использования уполномоченными АО «НСПК» получателями сообщения (уполномоченными лицами). Если Вы не являетесь уполномоченным лицом или Вам не известно, являетесь ли Вы таким уполномоченным получателем сообщения от АО «НСПК», то уведомляем, что любое раскрытие, распространение или копирование этого сообщения влечет за собой установленную законом ответственность. Если Вы не являетесь уполномоченным получателем сообщения, просим Вас незамедлительно информировать об этом отправителя и удалить полученное сообщение из системы. This e-mail message together with any attachments hereto contains confidential information and is intended for recipients authorized by NSPK only. Any disclosure, distribution or copying of this message entails liability established by law. If you are not an authorized recipient, please immediately inform the sender and delete this message from your information system.
On Tue, Mar 06, 2018 at 09:31:33AM +0000, Зиновик Игорь Анатольевич wrote:
Multiple same specifications for /.*. ...
setfiles: /sysroot/etc/selinux/targeted/contexts/files/file_contexts: Multiple same specifications for /.*.
My idea for reproducing this was: (1) Download your file_contexts file. (2) virt-builder fedora-27 \ --upload file_contexts:/etc/selinux/targeted/contexts/files/file_contexts \ --selinux-relabel However I wasn't able to reproduce it (with policycoreutils-2.7-15.fc29.x86_64). Also I don't see multiple ‘/.*’ lines in the file_contexts file. So I don't know. But it's still my opinion that it is a bug in policycoreutils. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
participants (2)
-
Richard W.M. Jones -
Зиновик Игорь Анатольевич