3

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.

  • 2
    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. – s3lph Dec 30 '14 at 14:34
  • @the_Seppi yes i'm using Ubuntu server (only command line). So, you means it is not possible ?? – gurupal singh Dec 30 '14 at 14:36
5

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.

  • Voila !! thanks for the answer. it worked but is this the same terminal session that what is in Ubuntu server ? – gurupal singh Dec 30 '14 at 15:01
  • No, it starts a new bash session, which you probably can't access from the VM's screen. – s3lph Dec 30 '14 at 15:04
  • No, i mean if i run any command on putty terminal, it will the same for Ubuntu server ...right ?? – gurupal singh Dec 30 '14 at 15:08
  • 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. – s3lph Dec 30 '14 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.