Editing files on virtual machine

13,737

Solution 1

There is a also another way: share your folders between the two machines. This way you will not have any duplicates lying aroung, and you will save space. Also, you will have your files always accessible, and you work on them with whichever instrument you see fit. This is not alternative to installing Sublime on Ubuntu, just complementary.

The procedure given below allows you to share folders on the host machine with the guest machine. This is the most convenient solution because you will always have your files at hand, whether the VM is on or off. If your files are initially on the guest, follow this procedure to establish the new share dfolders, then, from within the guest, move all your already existing files to the shared folder.

This requires the Extension pack, which you can download from here: enter image description here

Now, with the VM turned off, in the VM settings panel, click on Shared folders: enter image description here

Now click on "add a new folder", which is the icon where my cursor is located:enter image description here

And now fill the little form which will have appeared as you see fit:enter image description here

Remember to check the Auto-mount option, there is no need to have to do it manually every time.

When you start the VM, said folders will be shared.

Solution 2

You can install sublime text on your VM, but if you have SSH access on your VM, you can use SSH, cyberduck and sublime text together to do this in a fairly seamless way.

You need to set sublime text to be the editor for cyberduck - go to edit -> preferences, then "choose" and point it at sublime text . I've already done this, and its pretty much the same as you would when setting a program to open a filetype anywhere.

enter image description here

You can then log in to your server using cyberduck - these settings work for me, and use sftp, though in theory you can use any other transfer type that is supported.

enter image description here

rightclick on the file you want to edit, select edit with, and select default, or sublime text

enter image description here

You can edit the file as it was a local file, and save it and it should sync back to your server.

Share:
13,737

Related videos on Youtube

kuzyo
Author by

kuzyo

Updated on September 18, 2022

Comments

  • kuzyo
    kuzyo over 1 year

    I installed virtul Linux on my Windows XP through Virtual Box for using Ruby on Rails, but found one problem all my files that work with Rails directories is on virtual machine and I can’t edit them with my Sublime text that is on Windows. Should I install Sublime on virtual Linux or I can edit files in some another way? Thanks for response.

  • kuzyo
    kuzyo over 10 years
    Thanks @Journeyman Geek. Downloaded and installed syberduck, but have some problem with connection - my real machine have this ip 192.168.1.2, virtual this one 192.168.1.4 what should I enter in Username(admin name of my real machine?) and password( to my linux VM or password to my wirless connection?). Sorry for stupid question. I appreciate your help
  • Randy L
    Randy L over 10 years
    doesn't seem to work very well with my old-ass CentOS 5 install. not sure why.