Unable to delete a file

Asked by Fariborz Nassermostofi

Hi,

I had installed VMware 10 on my ubuntu 14.10.
After i uninstalled it, i realized that a process called vmware-ifconfig is running and when i have no network connection
it consumes almost all my cpu resource.

after a smal investigation i found out that there are two files in my system which are:
1- /etc/init.d/vmware-network
2- /usr/sbin/vmware-ifconfig

so i tried to delete these files. but i couldnt. even not as root. although these files belong to root.

this is the result of ls -l on vmware-network
-rwxr-xr-x 1 root root 534 فوریه 11 23:43 vmware-network*

this is the result of ls -l on vmware-ifconfig
-rwxr-xr-x 1 root root 4313800 ژانوی 15 16:13 vmware-ifconfig*

I realy dont understand it. now my question is how i can uninstall vmware completely and why there is a file
that even root can not delete it.

thx in advance for your help

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

How did you install VMWare?

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#2

with the following command

sudo sh ./setup.i386.bundle

and uninstall is done with

vmware-installer --uninstall-product vmware-workstation

but after uninstall those two files remain.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Maybe there is still a process running.

What is the output of the terminal commands

uname -a
lsb_release -crid
sudo updatedb
locate vmware
ps ax | grep vmware
sudo fuser -v /etc/init.d/vmware-network
sudo fuser -v /usr/sbin/vmware-ifconfig

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Was going to request that myself...

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#5

#uname -a
Linux zaal 3.16.0-30-generic #40-Ubuntu SMP Mon Jan 12 22:07:27 UTC 2015 i686 i686 i686 GNU/Linux

#lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 14.10
Release: 14.10
Codename: utopic

#sudo updatedb

#locate vmware
/etc/init.d/vmware-network
/etc/rc2.d/S01vmware-network
/etc/rc3.d/S01vmware-network
/etc/rc5.d/S01vmware-network
/home/fariborz/.vmware
/home/fariborz/.vmware/inventory.vmls
/home/fariborz/.vmware/preferences
/home/fariborz/.vmware/shortcuts

/usr/bin/vmwarectrl
/usr/lib/i386-linux-gnu/directfb-1.2-9/gfxdrivers/libdirectfb_vmware.so
/usr/lib/xorg/modules/drivers/vmware_drv.so
/usr/sbin/vmware-ifconfig
/usr/share/app-install/icons/_usr_share_pixmaps_vmware-player.png
/usr/share/apport/package-hooks/source_xserver-xorg-video-vmware.py
/usr/share/apport/package-hooks/xserver-xorg-video-vmware-lts-quantal.py
/usr/share/bug/xserver-xorg-video-vmware
/usr/share/bug/xserver-xorg-video-vmware/script
/usr/share/doc/xserver-xorg-video-vmware
/usr/share/doc/xserver-xorg-video-vmware/changelog.Debian.gz
/usr/share/doc/xserver-xorg-video-vmware/copyright
/usr/share/grub-gfxpayload-lists/blacklist/10_vmware
/usr/share/man/man4/vmware.4.gz
/usr/share/mime/application/x-vmware-enc-vm.xml
/usr/share/mime/application/x-vmware-snapshot.xml
/usr/share/mime/application/x-vmware-team.xml
/usr/share/mime/application/x-vmware-vm.xml
/usr/share/mime/application/x-vmware-vmdisk.xml
/usr/share/mime/application/x-vmware-vmfoundry.xml
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/vmci/vsockets.h
/var/lib/vmware
/var/lib/dpkg/info/xserver-xorg-video-vmware.conffiles
/var/lib/dpkg/info/xserver-xorg-video-vmware.list
/var/lib/dpkg/info/xserver-xorg-video-vmware.md5sums
/var/lib/vmware/hostd
/var/log/vmware
/var/log/vmware-installer
/var/log/vmware/hostd-1.log.gz
/var/log/vmware/hostd-2.log.gz
/var/log/vmware/hostd-3.log.gz
/var/log/vmware/hostd-4.log.gz
/var/log/vmware/hostd-5.log.gz
/var/log/vmware/hostd-6.log
/var/log/vmware/hostd.log

#ps ax | grep vmware
12771 pts/27 S+ 0:00 grep --color=auto vmware

#sudo fuser -v /etc/init.d/vmware-network

#sudo fuser -v /usr/sbin/vmware-ifconfig

Few of the commands have no output.

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

I do not see anything strange.

What is the output of the commands

sudo rm -v /etc/init.d/vmware-network
sudo rm -v /usr/sbin/vmware-ifconfig

and if that again fails

file /etc/init.d/vmware-network
file /usr/sbin/vmware-ifconfig

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#7

#sudo fuser -v /usr/sbin/vmware-ifconfig
                                         BEN. PID ZUGR. BEFEHL
/usr/sbin/vmware-ifconfig:
                                        root 1358 f..e. vmware-ifconfig

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

Now there is a process shown that accesses one of the two files; such process was not shown in the previous output. Have you restarted you computer since the previous output? (process ID 1358, executing vmware-ifconfig)

The terminal command

sudo fuser -vk /usr/sbin/vmware-ifconfig

should kill that process, and you should then be able to delete that file.

I assume you have to delete these four files

/etc/init.d/vmware-network
/etc/rc2.d/S01vmware-network
/etc/rc3.d/S01vmware-network
/etc/rc5.d/S01vmware-network

to avoid that a new process is started after the next reboot.

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#9

yes i had restarted my laptop.

sudo rm /etc/init.d/vmware-network
rm: das Entfernen von »/etc/init.d/vmware-network“ ist nicht möglich: Die Operation ist nicht erlaubt

as i said. even with user root and having killed the process, i am not able to remove those files.

i could delete now these three files
/etc/rc2.d/S01vmware-network
/etc/rc3.d/S01vmware-network
/etc/rc5.d/S01vmware-network
andn will restart now my laptop to see if the system will again access the /etc/init.d/vmware-network file and will report it again.

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#10

rebooted the system.
the vmware-ifconfig is not more running.
but both files /etc/init.d/vmware-network and /usr/sbin/vmware-ifconfig
are still there and i am still not able to delete them. even not with the user root.

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

What is the output of

LANG=C ls -l /etc/init.d/vmware-network
LANG=C ls -l /usr/sbin/vmware-ifconfig
LANG=C file /etc/init.d/vmware-network
LANG=C file /usr/sbin/vmware-ifconfig

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#12

#LANG=C ls -l /etc/init.d/vmware-network
-rwxr-xr-x 1 root root 534 فو� 11 23:43 /etc/init.d/vmware-network

#LANG=C ls -l /usr/sbin/vmware-ifconfig
-rwxr-xr-x 1 root root 4313800 ژا� 15 16:13 /usr/sbin/vmware-ifconfig

#LANG=C file /etc/init.d/vmware-network
/etc/init.d/vmware-network: POSIX shell script, ASCII text executable

#LANG=C file /usr/sbin/vmware-ifconfig
/usr/sbin/vmware-ifconfig: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), stripped

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

I don't see any reason that the deletion of the files should not work.

What is the output of the terminal commands

LANG=C sudo rm -v /etc/init.d/vmware-network
echo $?
LANG=C sudo rm -v /usr/sbin/vmware-ifconfig
echo $?

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#14

LANG=C sudo rm -v /etc/init.d/vmware-network
rm: cannot remove '/etc/init.d/vmware-network': Operation not permitted

LANG=C sudo rm -v /etc/init.d/vmware-network
rm: cannot remove '/etc/init.d/vmware-network': Operation not permitted
echo $?
1

LANG=C sudo rm -v /usr/sbin/vmware-ifconfig
rm: cannot remove '/usr/sbin/vmware-ifconfig': Operation not permitted
echo $?
1

Revision history for this message
Manfred Hampl (m-hampl) said :
#15

Maybe there are special file attributes set

What is the output of

sudo lsattr /etc/init.d/vmware-network /usr/sbin/vmware-ifconfig

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#16

sudo lsattr /etc/init.d/vmware-network /usr/sbin/vmware-ifconfig
----i--------e-- /etc/init.d/vmware-network
----i--------e-- /usr/sbin/vmware-ifconfig

Revision history for this message
Manfred Hampl (m-hampl) said :
#17

I think that's it: the files have the 'immutable' attribute set.

Try

sudo chattr -i /etc/init.d/vmware-network /usr/sbin/vmware-ifconfig
sudo rm -v /etc/init.d/vmware-network /usr/sbin/vmware-ifconfig

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#18

wow wow wow
great
that works.
but what are these special attributes. and what about files found with locate under kernel like:

/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-23-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-25-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-28-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-29-generic/include/config/vmware/vmci/vsockets.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/balloon.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/pvscsi.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/vmci
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/vmci.h
/usr/src/linux-headers-3.16.0-30-generic/include/config/vmware/vmci/vsockets.h

could you explain this to me please?
Anyhow thanx a lot.

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#19

On file systems with exz2 ex3 or ext4 formatting you can set additional attributes (besides the standard access rights). It seems that the VMware installer has set the immutable flag on these files, leading to the situation that the files could not be easily removed. I would not care too much about that.

The .../include/config/vmware/... files below /usr/src/... that you listed are part of the standard Ubuntu kernel header packages.
They are not from the VMware workstation installation, but are part of a normal Ubuntu installation. You should leave them as they are. Similar for files with names containing xserver-xorg-video-vmware including those shown in http://packages.ubuntu.com/utopic/i386/xserver-xorg-video-vmware/filelist

Remark: You seem to have at least 5 versions of the kernel header package installed. Usually you should keep only the newest one or two and purge the older ones (those with lower version number) to free up space.

I assume if you run the command
sudo apt-get --purge autoremove
It will uninstall the outdated version and leave only the last one installed.
(You can test with "apt-get --simulate --purge autoremove" to see the list of packages that would be removed.)

Running "locate vmware" afterwards will then most probably show only the ...-3.16.0-30-... directory any more (and maybe the ...-3.16.0-29-... directory).

Revision history for this message
Fariborz Nassermostofi (fariborz) said :
#20

thx a lot.