VMware: NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver

Hello, im new to the community. I have seen multiple posts on the “nvidia smi driver failed to communicate problem”, however none of them seemed to work for me. The thing i want to install is cuda 10.0, on ubuntu 18.04 . However, im doing this on a virtual machine, which may be the reason why some of these below posts methods may not work.

The top answer of this post : https://askubuntu.com/questions/61396/how-do-i-install-the-nvidia-drivers/61433#61433

After doing this , i still get:

*The following packages have unmet dependencies:nvidia-driver-440 : Depends: nvidia-driver-450 but it is not going to be installed

E: Unable to correct problems, you have held broken packages.*

This one: NVIDIA-SMI has failed in Ubuntu 18.04

sudo apt install --reinstall gcc

However, after doing this i still get the same error message.
What can i do to resolve this situation? I am using ubuntu on a virtual machine, might this be the problem? Thanks for reading this post!