6 Replies Latest reply: Mar 7, 2013 5:50 PM by bobthesungeek76036 RSS

    Copy-paste to vi in virtualbox

    mjglbt
      Hi,

      I am not sure if this is the correct forum but I will give it a go. I have oracle linux as a guest inside virtualbox and windows 7 as a host.

      So this is what I am trying to do I copy some data in the host (windows) and then in the guest(linux) using vi of a file I want to paste that data from windows into the file it may be more then one line in some cases but it does not seem to work is there something I am missing. It's been a while since I used vi.

      When using vi inside linux how do you do a copy and paste from the host to the guest?

      Thanks
      mike
        • 1. Re: Copy-paste to vi in virtualbox
          EdStevens
          mjglbt wrote:
          Hi,

          I am not sure if this is the correct forum but I will give it a go. I have oracle linux as a guest inside virtualbox and windows 7 as a host.

          So this is what I am trying to do I copy some data in the host (windows) and then in the guest(linux) using vi of a file I want to paste that data from windows into the file it may be more then one line in some cases but it does not seem to work is there something I am missing. It's been a while since I used vi.

          When using vi inside linux how do you do a copy and paste from the host to the guest?

          Thanks
          mike
          It may depend on exactly where you are when you launch vi ... I'm not sure, because I never use the vm/vb console, and I never run the graphical desktop.

          Like you, I have VB installed on a Win7 host, with a linux vm running under VB. Actually 7 linux vm's. I always connect using putty from my host os -- just exactly like I connect to the real servers in my data center. My vm's are just another connection defined to putty. If I need to copy text into a file on my vm -- or a physical server in my data center - I connect to the server with putty, open the vile in vi, position where I want the insert, hit 'i' for 'insert', mouse over to the document I'm copying from and copy whatever, mouse back to the putty session and right-click to paste whatever is in the clip-board.
          • 2. Re: Copy-paste to vi in virtualbox
            User12611628-Oracle
            In your Oracle Linux guest VM, under the Virtual Box Devices ->Shared Clipboard menu option, you can select *'Host To Guest'* option. Then try copy/paste and see if it works.

            Edited by: user12611628 on Mar 7, 2013 11:32 AM
            • 3. Re: Copy-paste to vi in virtualbox
              Catch 22
              With the VirtualBox Guest Additions installed in the guest operating system, the "Shared Clipboard" option from the "Devices" menu of the virtual machine controls how clipboard data is shared between the guest and the host. It is by default disabled, but can be set to "bidirectional", "guest to host" or "host to guest". For more information I suggest to check the VirtualBox manual or post a question in the VirtualBox forum at https://forums.virtualbox.org.
              • 4. Re: Copy-paste to vi in virtualbox
                mjglbt
                I do have guest additions installed and working and am able to copy and paste but I am not sure how you would paste when using vi.
                • 5. Re: Copy-paste to vi in virtualbox
                  Catch 22
                  You need a X11 window manager and graphical console to have a clipboard manager and clipboard support. For instance, you can start a terminal program (xterm), open vi and then select "paste" from the standard application "Edit" menu. If you have a text based console, there is no central clipboard that can be shared.
                  • 6. Re: Copy-paste to vi in virtualbox
                    bobthesungeek76036
                    mjglbt wrote:
                    I do have guest additions installed and working and am able to copy and paste but I am not sure how you would paste when using vi.
                    I usually go into insert mode in vi (i) and paste using the terminal window "edit" -> "paste" and it seems to work fine for me.