How do I copy and paste from a Windows 7 host machine to a Ubuntu 12.04 terminal VirtualBox?

14,157

You say you're running Ubuntu Server, which usually means you aren't using any graphical frontend. But Copy&Pasting in Ubunu is managed by the Window Manager or Display Manager. So you can't really copy/paste there.

However, you could try enabling an SSH Server on the Ubuntu VM and then access it from the Windows console:


In VirtualBox's config: Select VM, then SettingsNetwork → Enable Adapter 1, attach to NAT.

In Ubuntu server:

  1. Install the OpenSSH server package: sudo apt-get install openssh-server
  2. Configure the server according to the OpenSSH server guide

In Windows:

  1. Download and install PuTTY
  2. (Re-) Boot the VM
  3. Use PuTTY to connect to Ubuntu Server (you can get the IP from ifconfig in Ubuntu's terminal). Use your Ubuntu username and password.

There you go. You should now have a Ubuntu Server terminal session in your Windows console. You can exit it using exit, logout or something in PuTTY.

Share:
14,157

Related videos on Youtube

gurupal singh
Author by

gurupal singh

Updated on September 18, 2022

Comments

  • gurupal singh
    gurupal singh over 1 year

    I am running VirtualBox on my Windows 7 laptop, running an Ubuntu 12.04 (Precise Pangolin) Server as guest machine.

    I would like to copy some commands (which are too long to write on terminal) from Windows 7 (host machine) to my guest machine's terminal so that it will be easy for me to run commands.

    I had guest additions successfully installed.

    • s3lph
      s3lph over 9 years
      You say you're running Ubuntu Server, which usually means you aren't using any graphical frontend. But Copy&Pasting in Ubunu is managed by the Window Manager or Display Manager. So you can't really copy/paste there.
    • gurupal singh
      gurupal singh over 9 years
      @the_Seppi yes i'm using Ubuntu server (only command line). So, you means it is not possible ??
  • gurupal singh
    gurupal singh over 9 years
    Voila !! thanks for the answer. it worked but is this the same terminal session that what is in Ubuntu server ?
  • s3lph
    s3lph over 9 years
    No, it starts a new bash session, which you probably can't access from the VM's screen.
  • gurupal singh
    gurupal singh over 9 years
    No, i mean if i run any command on putty terminal, it will the same for Ubuntu server ...right ??
  • s3lph
    s3lph over 9 years
    I don't really understand what you're asking... The terminal you see in PuTTY is a terminal of your Ubuntu server, which you interact with via the network. Everything you execute there will be executed in the VM, but you will only see the output in PuTTY, not in the VM's window.