LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copying text within a .pub file? (https://www.linuxquestions.org/questions/linux-newbie-8/copying-text-within-a-pub-file-4175439108/)

LukasH 11-28-2012 05:39 AM

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! :-)

markush 11-28-2012 05:58 AM

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

LukasH 11-28-2012 06:00 AM

Hey markus,

yes, I do know that, sorry for the confusion about saying VM and VIM. So, how can I enable shared folders?

markush 11-28-2012 06:01 AM

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

LukasH 11-28-2012 06:09 AM

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.

markush 11-28-2012 06:10 AM

Did you install the guest additions?

LukasH 11-28-2012 06:16 AM

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 :(.

markush 11-28-2012 06:36 AM

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

LukasH 11-28-2012 06:40 AM

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?

markush 11-28-2012 06:43 AM

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

LukasH 11-28-2012 06:55 AM

Damn, I was hoping for a fine, quick solution. Oh well, I'm off reading documentation then - thanks for the help!

markush 11-28-2012 07:01 AM

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


All times are GMT -5. The time now is 06:46 AM.