Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to pull from git on a Ubuntu Server inside of Virtualbox

Tags:

git

ubuntu

I have a Virtualbox VM with Ubuntu server running with networking set to bridged.

I've installed git, initialized a repo, added my key to my github account, and ran ssh -T [email protected] all with no errors.

My problem comes when I try to actually pull a repo. No matter what repo I attempt to pull, I get the error Permission denied (publickey). fatal: The remote end hung up unexpectedly

So, any tips on getting this working?

Thanks.

like image 456
Samsquanch Avatar asked Feb 26 '12 18:02

Samsquanch


People also ask

How do I share files between VirtualBox Ubuntu and host computer?

Create a shared folder. From Virtual menu go to Devices->Shared Folders then add a new folder in the list, this folder should be the one in windows which you want to share with Ubuntu(Guest OS). Make this created folder auto-mount. Example -> Make a folder on Desktop with name Ubuntushare and add this folder.

Why Ubuntu is not opening in VirtualBox?

Your OS can get corrupted, which as a result can make your Ubuntu crawl. So, go to ubuntu.com/download and download the Ubuntu ISO. Then install it on your VirtualBox, allocate it a good amount of resources, and hopefully, it will do the job for you.


2 Answers

I've found a workaround 'fix':

The problem seems to be trying to pull in 'Bridged' mode in Virtualbox. If I switch networking to NAT I can successfully pull, then I switch back to Bridged to work locally, then back to NAT when it's time to push.

It's not the most convenient fix, but it works for now. If anyone has a suggestion to make this better, I'm all ears.

like image 185
Samsquanch Avatar answered Sep 28 '22 06:09

Samsquanch


What worked for me was to set my github user and password to the command line that asks to clone the repository. Since in your vm you are not logged in github..

What I did was: git clone https://username:[email protected]/repositoriUrl.git

(Being username your github user account name, password your github pass and repositoryUrl.git the url for your repository).

I hope this helps!

like image 30
letie Avatar answered Sep 28 '22 05:09

letie