LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-28-2012, 05:39 AM   #1
LukasH
Member
 
Registered: Jul 2012
Posts: 31

Rep: Reputation: Disabled
Copying text within a .pub file?


Hello everyone,

I just installed Ubuntu Server on a VM. Then I created a new SSH key and I am now trying to get that from the guest machine to the host machine. Is there any way of using copy and paste? Found a lot of vim commands (http://www.tuxfiles.org/linuxhelp/vimcheat.html), but oviously I am too stupid to get the right use of those "y" commands.

I am not too used to Linux or vim or anything within the terminal, so please help! :-)

Last edited by LukasH; 11-28-2012 at 05:43 AM.
 
Old 11-28-2012, 05:58 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi,

Vim is an editor and has nothing to do with a vm (virtual machine).

If you want to copy files between a virtualmachine and a host, you'll have to share folders of the host, so that you can access them from the guest.

If you are using virtualbox, you will have to install the "guest additions" before you can share the folders.

Markus
 
Old 11-28-2012, 06:00 AM   #3
LukasH
Member
 
Registered: Jul 2012
Posts: 31

Original Poster
Rep: Reputation: Disabled
Hey markus,

yes, I do know that, sorry for the confusion about saying VM and VIM. So, how can I enable shared folders?
 
Old 11-28-2012, 06:01 AM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Which vm are you using? virtualbox or vmware? or what?

You could also simply configure nfs on the server and then access these folders from the host.

Markus
 
Old 11-28-2012, 06:09 AM   #5
LukasH
Member
 
Registered: Jul 2012
Posts: 31

Original Poster
Rep: Reputation: Disabled
I am using Virtualbox. What I am trying to do in general is setting up a new "Vagrant box" (www.vagrantup.com"), but to finish my system, I want to pull a repo from github that requires SSH. To send my ssh key, I want to copy it from the guest client to the host machine . That is all that I want.
 
Old 11-28-2012, 06:10 AM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Did you install the guest additions?
 
Old 11-28-2012, 06:16 AM   #7
LukasH
Member
 
Registered: Jul 2012
Posts: 31

Original Poster
Rep: Reputation: Disabled
Yes, I did. Or lets say, I should have, I experienced problems doing this, but I think I was able to fix it. A few hours ago, I updated VirtualBox, but it didn't seem to affect the Guest additions.

Awww, wait a second. I actually forgot that the Guest Additions have to installed, who could've known, on the Guest. Okay... going for that.

I figured out by myself now how to handle copying inside the vi editor, it's just shift + v for marking everything, then going shift + p / shift + d.

Though that does not solve my problem .

Last edited by LukasH; 11-28-2012 at 06:36 AM.
 
Old 11-28-2012, 06:36 AM   #8
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
I think that every new version of Virtualbox comes with a new guest additions, you should install them. Then you can try to mount a shared directory in your guestsystem.

Markus
 
Old 11-28-2012, 06:40 AM   #9
LukasH
Member
 
Registered: Jul 2012
Posts: 31

Original Poster
Rep: Reputation: Disabled
Okay, that is done - Guest Additions are up and running.

So, how can I now get my copied SSH-key out of my .pub file and get it pasted within the host machine?
Basically, how do I mount that shared directory?
 
Old 11-28-2012, 06:43 AM   #10
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
I haven't yet virtualbox installed, os I can't say exactly what to do, you should read the documentation.

Anywhere in the Menu: "Devices"

Markus

Last edited by markush; 11-28-2012 at 06:45 AM.
 
Old 11-28-2012, 06:55 AM   #11
LukasH
Member
 
Registered: Jul 2012
Posts: 31

Original Poster
Rep: Reputation: Disabled
Damn, I was hoping for a fine, quick solution. Oh well, I'm off reading documentation then - thanks for the help!
 
Old 11-28-2012, 07:01 AM   #12
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
From the manual:
Quote:
To share a host folder with a virtual machine in VirtualBox, you must specify the path of that folder and choose for it a "share name" that the guest can use to access it. Hence, first create the shared folder on the host; then, within the guest, connect to it.

There are several ways in which shared folders can be set up for a particular virtual machine:

- In the window of a running VM, you can select "Shared folders" from the "Devices" menu, or click on the folder icon on the status bar in the bottom right corner.

- If a VM is not currently running, you can configure shared folders in each virtual machine's "Settings" dialog.

- From the command line, you can create shared folders using VBoxManage, as follows:

Code:
VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test"
Markus
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening a .pub file dxdad Linux - Software 4 12-11-2014 05:40 PM
problem in copying the ssh public key (id_rsa.pub) over to the server 3abas Linux - General 1 07-15-2012 10:28 AM
scp truncate text file busy - copying file is not a running binary jetberrocal Linux - Server 3 06-24-2010 03:56 PM
Copying parts of a text file austen77 Linux - Newbie 3 09-01-2005 09:56 PM
Copying file in text mode? HadesThunder Linux - Newbie 5 03-30-2004 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration