Hide Forgot
Description of problem: Uploading files using openvmtools (version 9.10.2.48224 (build-2822639) to /var/tmp folder path failing on Rhel 7.2 VM Version-Release number of selected component (if applicable): 9.10.2.48224 (build-2822639) How reproducible: Upload files to /var/tmp folder on Rhel 7.2 VM, running with above mention tools version. https://<ESXServer>:443/guestFile?id=vmguid&token=XXXXXXXXX Steps to Reproduce: 1. 2. 3. Actual results: Instead of uploding to /var/tmp folder, It is creating folder 'systemd-private-XXXXXX-vmtoolsd.server-XXXX/tmp' and uploading here. [root@gkrhel72vm1 tmp]# vmtoolsd -v VMware Tools daemon, version 9.10.2.48224 (build-2822639) [root@gkrhel72vm1 tmp]# [root@gkrhel72vm1 ~]# cd /var/tmp/ [root@gkrhel72vm1 tmp]# ls -lrt total 0 drwxr-xr-x. 2 abrt abrt 6 Oct 14 01:28 abrt drwx------. 3 root root 16 Oct 14 01:28 systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht drwx------. 3 root root 16 Oct 14 01:28 systemd-private-810444509a4946488f0c4425f02b5933-rtkit-daemon.service-F3smmK drwx------. 3 root root 16 Oct 14 05:28 systemd-private-810444509a4946488f0c4425f02b5933-cups.service-qprVqF drwx------. 3 root root 16 Oct 14 05:30 systemd-private-810444509a4946488f0c4425f02b5933-colord.service-ySsT7F [root@gkrhel72vm1 tmp]# cd systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht/ [root@gkrhel72vm1 systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht]# ls tmp [root@gkrhel72vm1 systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht]# cd tmp/ [root@gkrhel72vm1 tmp]# ls -lrt total 8 -rw-r--r--. 1 root root 30 Feb 6 2015 test.txt -rw-r--r--. 1 root root 1639 Feb 6 2015 2.txt [root@gkrhel72vm1 tmp]# Expected results: Files (2.txt and test.txt) has to upload to /var/tmp folder. Additional info: On trying to upload to any other folder like /var/games OR etc... uploading is working. And same case is working properly with Rhel 7.0 with version 9.4.0.25793 (build-1280544).
You might want to try the RHEL 7.3 packages: http://oirase.annexia.org/tmp/bz1268537/
Hi Richard, Installed given openvmtools version 10.0.5.52125 (build-3227872) on my Rhel 7.2 vm and tried uploading files. Still it is uploading to folder 'systemd-private-XXXXXX-vmtoolsd.server-XXXX/tmp' instead of '/var/tmp' folder. Please take a look at this issue. [root@gkrhel72vm1 /]# vmtoolsd -v VMware Tools daemon, version 10.0.5.52125 (build-3227872) [root@gkrhel72vm1 /]# cd /var/tmp/ [root@gkrhel72vm1 tmp]# ls -lrt total 0 drwxr-xr-x. 2 abrt abrt 6 Oct 14 01:28 abrt drwx------. 3 root root 16 Oct 21 02:30 systemd-private-2e74bd223e244acb8957c132e8f0697f-rtkit-daemon.service-ereO3P drwx------. 3 root root 16 Oct 21 02:30 systemd-private-2e74bd223e244acb8957c132e8f0697f-vmtoolsd.service-kT4aoN drwx------. 3 root root 22 Oct 21 06:00 systemd-private-af2b238592334db4ab8764b42e6cbb30-vmtoolsd.service-Vg4OLNoldwith7point2vmtoolsd drwx------. 3 root root 16 Oct 21 06:30 systemd-private-2e74bd223e244acb8957c132e8f0697f-cups.service-xBtsHp drwx------. 3 root root 16 Oct 21 06:30 systemd-private-2e74bd223e244acb8957c132e8f0697f-colord.service-o8522p [root@gkrhel72vm1 tmp]# cd systemd-private-2e74bd223e244acb8957c132e8f0697f-vmtoolsd.service-kT4aoN [root@gkrhel72vm1 systemd-private-2e74bd223e244acb8957c132e8f0697f-vmtoolsd.service-kT4aoN]# ls -lrt total 0 drwxrwxrwt. 2 root root 40 Oct 21 06:33 tmp [root@gkrhel72vm1 systemd-private-2e74bd223e244acb8957c132e8f0697f-vmtoolsd.service-kT4aoN]# cd tmp/ [root@gkrhel72vm1 tmp]# ls -lrt total 52 -rw-r--r--. 1 root root 21508 Jan 21 2015 Xorg.9.log -rw-r--r--. 1 root root 28175 Mar 15 2016 Xorg.0.log [root@gkrhel72vm1 tmp]#
Right, I understand. This is because we (Red Hat) added a downstream patch which enables PrivateTmp for the vmtoolsd service. This was added to harden vmtoolsd against possible tmp exploits. If you look in (IIRC) /usr/lib/systemd/system/vmtoolsd.service you will see a line: PrivateTmp=true You can comment out that line and restart the service if you wish. An alternative is to upload to a non-tmpdir directory.
@dev-unix-virtualization I'm curious what is the use case for uploading files to public 'tmp'? Could you please help us understand? Rich, would enabling PrivateTmp by default break all such users? Should PrivateTmp be disabled by default?
Rich, Thanks for the information. After comment out 'PrivateTmp=true' line, upload files to /var/tmp worked. As mentioned earlier upload to other destination folders are working. Ravindra, Part of CommVault Guest file level restores, will upload files to Guest VM's given destination path. When a customer uses '/var/tmp' as destination with open-vmtools running VM, uploads are not going to given destination path. Which is working with VMware Tools running VM. Hence we got a customer case.
(In reply to Ravindra Kumar from comment #5) > Rich, would enabling PrivateTmp by default break all such users? Should > PrivateTmp be disabled by default? Rich, could you please respond to my question above?
I did, back in October, off-list. I've forwarded the same email to you again just now.
Open VMware Tools (CVE-2015-5191) issue fixed upstream 9.10.x – https://github.com/vmware/open-vm-tools/commit/c1304ce8bfd9c0c33999e496bf7049d5c3d45821 10.0.x - https://github.com/vmware/open-vm-tools/commit/b3068b04880eda4ca3e13f2d34fb8ce336ad1a4f 10.1.x - https://github.com/vmware/open-vm-tools/commit/22e58289f71232310d30cf162b83b5151a937bac
We will remove the PrivateTmp line in RHEL 7.5 which should fix this. See also https://bugzilla.redhat.com/show_bug.cgi?id=1318736
(In reply to dev-unix-virtualization from comment #0) > Description of problem: > Uploading files using openvmtools (version 9.10.2.48224 (build-2822639) to > /var/tmp folder path failing on Rhel 7.2 VM > > Version-Release number of selected component (if applicable): > 9.10.2.48224 (build-2822639) > > How reproducible: > Upload files to /var/tmp folder on Rhel 7.2 VM, running with above mention > tools version. > https://<ESXServer>:443/guestFile?id=vmguid&token=XXXXXXXXX > > Steps to Reproduce: > 1. > 2. > 3. > > Actual results: > Instead of uploding to /var/tmp folder, It is creating folder > 'systemd-private-XXXXXX-vmtoolsd.server-XXXX/tmp' and uploading here. > > [root@gkrhel72vm1 tmp]# vmtoolsd -v > VMware Tools daemon, version 9.10.2.48224 (build-2822639) > [root@gkrhel72vm1 tmp]# > > [root@gkrhel72vm1 ~]# cd /var/tmp/ > [root@gkrhel72vm1 tmp]# ls -lrt > total 0 > drwxr-xr-x. 2 abrt abrt 6 Oct 14 01:28 abrt > drwx------. 3 root root 16 Oct 14 01:28 > systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht > drwx------. 3 root root 16 Oct 14 01:28 > systemd-private-810444509a4946488f0c4425f02b5933-rtkit-daemon.service-F3smmK > drwx------. 3 root root 16 Oct 14 05:28 > systemd-private-810444509a4946488f0c4425f02b5933-cups.service-qprVqF > drwx------. 3 root root 16 Oct 14 05:30 > systemd-private-810444509a4946488f0c4425f02b5933-colord.service-ySsT7F > [root@gkrhel72vm1 tmp]# cd > systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht/ > [root@gkrhel72vm1 > systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht]# ls > tmp > [root@gkrhel72vm1 > systemd-private-810444509a4946488f0c4425f02b5933-vmtoolsd.service-51C4Ht]# > cd tmp/ > [root@gkrhel72vm1 tmp]# ls -lrt > total 8 > -rw-r--r--. 1 root root 30 Feb 6 2015 test.txt > -rw-r--r--. 1 root root 1639 Feb 6 2015 2.txt > [root@gkrhel72vm1 tmp]# > > > Expected results: > Files (2.txt and test.txt) has to upload to /var/tmp folder. > > Additional info: > On trying to upload to any other folder like /var/games OR etc... uploading > is working. > And same case is working properly with Rhel 7.0 with version 9.4.0.25793 > (build-1280544). Hi, For this issue trace, maybe need your great help to check. For reproduced step and environment: > Upload files to /var/tmp folder on Rhel 7.2 VM, running with above mention > tools version. > https://<ESXServer>:443/guestFile?id=vmguid&token=XXXXXXXXX Q1. What's your test environment, my test environment is under esxi6.0. Q2. Need your help to detail the steps how to upload file to /var/tmp with open-vm-tools in your environment. Thanks very much.
Hi Reporter, If you are free, please help to reply Comment 11. Thanks a loooot.
(In reply to Richard W.M. Jones from comment #10) > We will remove the PrivateTmp line in RHEL 7.5 which should fix this. > See also https://bugzilla.redhat.com/show_bug.cgi?id=1318736 Ravindra, If PrivateTmp line is removed in RHEL 7.5, will this fix this?
(In reply to John Savanyo from comment #13) > Ravindra, If PrivateTmp line is removed in RHEL 7.5, will this fix this? Yes. That's correct.
This is believed to be FIXED in RHEL 7.5, but unfortunately I cannot get the flags right so I'll have to move the BUG to 7.6. Note this doesn't affect anything in reality.
(In reply to Richard W.M. Jones from comment #15) > This is believed to be FIXED in RHEL 7.5, but unfortunately I cannot > get the flags right so I'll have to move the BUG to 7.6. Note this > doesn't affect anything in reality. Hi Richard, Could you help to provide the steps how to upload files to VM with open-vm-tools in VMware ESXi? It seems reporter missed the comment. Look forward your steps, if I can verify this issue in current open-vm-tools, will be useful to push this BZ forwardly. Thanks. BR, BO
I've no idea, but hopefully Ravindra knows.
This requires invoking initiateFileTransferToGuest (https://pubs.vmware.com/vsphere-6-5/topic/com.vmware.wssdk.apiref.doc/vim.vm.guest.FileManager.html#initiateFileTransferToGuest) guest operation. There are several ways to invoke guestOps depending on the environment available, e.g. vSphere SDK (https://code.vmware.com/web/sdk/6.7/vsphere-management) or PowerCLI (https://code.vmware.com/web/dp/tool/vmware-powercli) or pyVmomi based script like https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/upload_file_to_vm.py (depends on https://github.com/vmware/pyvmomi). Typically, guestOperations are performed via VC, but directly using ESXi host should work too. You can also find some VMware blogs about performing guestOperations, like https://www.virtuallyghetto.com/2011/07/automating-new-integrated-vixguest.html.
WW08.1 UPDATE: Thanks @Ravindra's help. Checked out RHEL7.2 (open-vm-tools-9.10.2-4.el7.x86_64) and reproduced it with POWERCLI cmdlet Copy-VMGuestFile. Steps to Reproduce: 1. Confirm target RHEL7.2 installs a open-vm-tools-9.10.2-4.el7.x86_64 2. In a local, HERE, a windows installs POWERCLI 3. Copy-VMGuestFile -Source C:\test.txt -Destination /var/tmp/ -VM $VM -GuestToLocal -GuestUser root -GuestPassword redhat Result: 1. After step 3, check /var/tmp, OVT creates a new path for the target file. /var/tmp/systemd-private-8cbfe5e5f33f40308887e8ffc0f8a36d-vmtoolsd.service-r6w0if BR, BO
WW08.1 UPDATE: Verified this BZ in RHEL7.5(open-vm-tools-10.1.10-3.el7.x86_64) and RHEL7.6(open-vm-tools-10.2.5-3.el7.x86_64), can't reproduce it. Steps to Verify: 1. Confirm target RHEL7.5 / RHEL7.6 OVT version 2. In a local, HERE, a windows installs POWERCLI 3. Copy-VMGuestFile -Source C:\test.txt -Destination /var/tmp/ -VM $VM -GuestToLocal -GuestUser root -GuestPassword redhat Result: 1. After step 3, check /var/tmp, target file is here Close this BZ, if you have any quesiton or requirement, re-open it. BR, BO