Monday, May 30, 2016

Fixing VMWARE tools on kali linux to enable copy paste properly - especially when you are doing OSCP

Hi Folks,

So if you are playing around with kali linux on a VM you might have faced the issue of getting the vmware tools work properly. Especially when you want to copy paste files and clipboard contents between guest and host. This is very annoying thing and took lot of my precious time when i was doing OSCP course. Here is how i fixed it.



My Setup


I run a kali linux distro on vmware player which is recommended for doing the OSCP course. By default it has GNOME as the default GUI. I kind of hate it as it uses lot of resources and has all those stupid animations and stuff. I want something clean and precise when i am working, i am not into looks and too many features, just the bare minimum responsive system is always my favourite.

So I installed LXDE which is light weight GUI for linux. you can install it with following command

apt-get install lxde-core lxde kali-defaults kali-root-login desktop-base


This will not make LXDE you default GUI, so if you reboot, you will need to choose LXDE from the menu while logging in. To make it default you can run the command

 update-alternatives --config x-session-manager

Now you will be presented with a wizard like interface to choose default GUI, choose LXDE if you want to make it default GUI.

First things First


First of all, Kali Linux new versions comes with open vm tools pre installed, this should supposedly enable all functionalities but unfortunately it doesn't work just like that. So typically eveyone installs VMware tools on top of this.

To fix it properly first remove any additional libraries that you have installed, in my case its vmware tools. To uninstall it you have to issue the command

/usr/bin/vmware-uninstall-tools.pl

if you have virtualbox additions you can uninstall it  by the something like this (based on version it may differ)

/opt/VBoxGuestAdditions-5.0.16/uninstall.sh

just make sure its all gone for good

sudo aptitude purge virtualbox-guest-x11 virtualbox-dbg virtualbox-dkms

Now uninstall open vm tools

aptitude purge open-vm-tools open-vm-tools-desktop open-vm-tools-dkms

Remove any residual files

rm -rf /etc/vmware-tools/

Now that everything is properly gone. Do a restart to clean up everything.


Lets start


Lets install open vm tools properly

apt-get install open-vm-tools open-vm-tools-desktop fuse

Now open the file /etc/rc.local on a text editor and add following lines towards the end of file just before the exit 0 statement

sudo mkdir /var/run/vmblock-fuse
sudo su -l -c "vmware-vmblock-fuse -o subtype=vmware-vmblock,default_permissions,allow_other /var/run/vmblock-fuse"

Now create a file /root/.config/autostart/copypaste-autostart.desktop with following contents

[Desktop Entry]
Type=Application
Name=copypaste start
Comment=Start copy paste and drag n drop for vm tools
Exec=/root/Desktop/OSCP/setup/cpaste.sh
OnlyShowIn=LXDE
Now create a file /root/Desktop/OSCP/setup/cpaste.sh  (note: you can create in any location, just make sure to add that location on the previous step file contents for parameter Exec) with following contents

#!/bin/sh -e
sudo chmod u+s /usr/bin/vmware-user-suid-wrapper
vmware-user-suid-wrapper


Thats it. Now restart and you should have copy paste functionality working properly. In case drag and drop does not work, just right click copy and then paste it works everytime for me.

Enjoy. Please do provide your feedback. 





27 comments:

  1. Replies
    1. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes. IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble.Final Year Projects for CSE

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining .

      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

      The Angular Training covers a wide range of topics including Angular Directives, Angular Services, and Angular programmability.Angular Training

      Delete
  2. Such a shame VMware Tools couldn't work properly by default

    vmware backups

    ReplyDelete
  3. Esay to follow steps for an effective vmware backups , thanks!


    ReplyDelete

  4. You write this post very carefully I think, which is easily understandable to me. Not only this, but another post is also good. As a newbie, this info is really helpful for me. Thanks to you.
    Tally ERP 9 Training
    tally classes
    Tally Training institute in Chennai
    Tally course in Chennai

    ReplyDelete
  5. Nice blog, it’s so knowledgeable, informative, and good looking site. I appreciate your hard work. Good job. Thank you for this wonderful sharing with us. Keep Sharing.
    Digital Marketing Course In Kolkata
    Web Design Course In Kolkata

    ReplyDelete
  6. online Quran classes on Islam has given, and ensure the youngster numerous rights, and these ?rights are ?ensured by Islam to all kids, ?for example, the privilege to instruction, and charged guardians and moms and different guardians to train youngsters all that they need after adolescence learn Quran particularly Quran internet perusing? Go along with us now and welcome your loved ones both youthful and old and you will discover all that you need to learn here. https://patendo.com/cara-membuat-merek/

    ReplyDelete
  7. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. SEO Company Vancouver

    ReplyDelete
  8. Excellent post. I was reviewing this blog continuously, and I am impressed! Extremely helpful information especially this page. Thank you and good luck. semrush pricing

    ReplyDelete
  9. Thank you so much for sharing this article. I really love it. This is a very nice one and gives in-depth information. I am really happy with the quality and presentation of the article. I’d really like to appreciate the efforts you get with writing this post. Thanks for sharing.

    website: Kalyan Matka

    ReplyDelete
  10. I use only high quality materials - you can see them at: check over here

    ReplyDelete
  11. Additionally, think about the closures of the sledge. There are torn finishes and adjusted closures. power tools

    ReplyDelete
  12. I just would like to give a huge thumbs up for the great info you have here on this post. Thanks for sharing with us. Are you looking for Escort Services in Ahmedabad and Call Girls in Ahmedabad
    Click For More Information Escort Services in Ahmedabad

    ReplyDelete
  13. Good website! I truly love how it is easy on my eyes it is. I am wondering how I might be notified whenever a new post has been made. I have subscribed to your RSS which may do the trick? Have a great day! Software for writers

    ReplyDelete
  14. As the first-generation rechargeable disposable cannabis vape pen by Cilicon, SOLO has gained great attention from cannabis companies and cannabis vapors. Since SOLO faces the cannabis world, we have received many reviews and questions about SOLO. In this introduction, we will introduce SOLO to resolve all your focus. For more information at disposable vape

    ReplyDelete
  15. Would you be able to utilize the GUI to characterize boundaries and worldwide information for the experiments or would you say you are needed to compose code as you would on the off chance that you were trying physically? targonca szállítás Debrecen Europa-Road Kft.

    ReplyDelete
  16. What should you care about when you choose Delta-10 THC Vape Cartridge and disposable? here are the details about Delta-10 THC, a suitable vape cartridge, and disposable vape pen. Read more at the delta cartridge.

    ReplyDelete
  17. Thanks for Sharing this Valuable Information with us: this is very useful for me. Keep it Up. Trending Blogs India 2021, Most Popular Blog Topics India 2021, Trending Topics in India 2021
    Visit here - india and china latest news

    ReplyDelete
  18. I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. Direct Response Copywriter

    ReplyDelete
  19. We are most trusted chevy dealership peoria il, where you can find new or used Chevrolet models.
    Visit here - Chevy Dealership Peoria Il

    ReplyDelete
  20. Nice to be visiting your blog. satta matka, kalyan matka number, matka result, kalyan main matka tips
    For More Details - Sattamatka

    ReplyDelete
  21. Are you looking for end of lease pest spray services in Melbourne? Pest control is essential after your house lease has ended because it is part of the lease agreement. Hilux Services offer exceptional end of lease fumigation, end of tenancy, and end of lease flea treatment to remove all sorts of pests from your leased home at affordable prices. End Of Lease Pest Control

    ReplyDelete
  22. Black Anti Static ESD Safe Foam is made from Low Density Polyethylene (LDPE) resins with anti static additive. Black Anti Static ESD Safe Foam are excellent for packaging fine surface finish 3C products and other high grade products. Visit our website anti static foam to learn more.

    ReplyDelete