RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1387444 - [ESXi][RHEL7.2]Uploading files using openvmtools to /var/tmp folder path failing on Rhel 7.2 VM
Summary: [ESXi][RHEL7.2]Uploading files using openvmtools to /var/tmp folder path fail...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: open-vm-tools
Version: 7.2
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Cathy Avery
QA Contact: Bo Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-20 22:44 UTC by dev-unix-virtualization
Modified: 2019-07-15 12:21 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-02-18 07:42:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description dev-unix-virtualization 2016-10-20 22:44:10 UTC
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).

Comment 2 Richard W.M. Jones 2016-10-21 07:37:24 UTC
You might want to try the RHEL 7.3 packages:

http://oirase.annexia.org/tmp/bz1268537/

Comment 3 dev-unix-virtualization 2016-10-21 16:55:14 UTC
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]#

Comment 4 Richard W.M. Jones 2016-10-21 17:11:03 UTC
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.

Comment 5 Ravindra Kumar 2016-10-25 17:54:27 UTC
@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?

Comment 6 dev-unix-virtualization 2016-10-31 20:02:14 UTC
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.

Comment 7 Ravindra Kumar 2017-02-25 04:27:39 UTC
(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?

Comment 8 Richard W.M. Jones 2017-02-25 10:59:33 UTC
I did, back in October, off-list.  I've forwarded the same
email to you again just now.

Comment 10 Richard W.M. Jones 2017-07-26 10:23:02 UTC
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

Comment 11 Bo Yang 2017-08-04 03:14:48 UTC
(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.

Comment 12 Bo Yang 2017-08-21 01:56:27 UTC
Hi Reporter,

If you are free, please help to reply Comment 11.

Thanks a loooot.

Comment 13 John Savanyo 2017-08-30 00:00:43 UTC
(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?

Comment 14 Ravindra Kumar 2017-08-30 00:41:34 UTC
(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.

Comment 15 Richard W.M. Jones 2018-02-05 16:00:48 UTC
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.

Comment 16 Bo Yang 2018-12-26 10:47:39 UTC
(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

Comment 17 Richard W.M. Jones 2019-01-14 16:23:42 UTC
I've no idea, but hopefully Ravindra knows.

Comment 18 Ravindra Kumar 2019-01-14 18:51:24 UTC
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.

Comment 19 Bo Yang 2019-02-18 07:21:15 UTC
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

Comment 20 Bo Yang 2019-02-18 07:42:23 UTC
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


Note You need to log in before you can comment on or make changes to this bug.