0

I currently have ubuntu 14.04 with lamp stack running in virtualbox under win 8.1. I use PhpStorm inside the virtualbox. Virtualbox is running fine except for some flickering and screen refresh issues sometimes.
I think maybe to run PhpStorm under Windows and share my home/project folder with samba. I would do svn/git commits from windows as well
Is it safe from any side effects like wrong file encoding or file rights?

jeff
  • 281
  • 1
  • 11
  • Sounds just like my PHP development environment. I don't see any problems with it. – Dan May 30 '14 at 12:51

1 Answers1

0

There shouldn't be any issues with using a VirtualBox for a LAMP stack.

Since you haven't mentioned any other uses for Ubuntu you have in your VirtualBox, might I suggest using a server edition of Ubuntu instead - that way you can save on some resources.

If you need a graphical environment to change configuration files, you can use something like webmin. Which you can install using the below command:

sudo apt-get install webmin

You can also use svn or git to push things to LAMP instead of using samba, or you could use sftp - which would be better. You simply have to install an ssh server, this answer shows you how (note, you might have to change gedit to nano in several commands if you are using Ubuntu server, if you are using the desktop edition you can follow the guide as-is):

How to set up Ubuntu SFTP server? by firefly2442

The best resource to help you begin setting up an ssh service on a host machine using Ubuntu is OpenSSH Server. This will allow you to use SSH File Transfer Protocol (also Secure File Transfer Protocol, or SFTP) to access, transfer, and manage files over SSH.

Overview of Solution

  • On Ubuntu you can setup an OpenSSH server on a host machine and a user can then use ssh to connect from their client machine to the host machine's server using only a username and password. Note, however, that public key authentication is recommended,

"Make sure you have a strong password before installing an SSH server (you may want to disable passwords altogether)"

  • Administrative User Accounts created on the host machine will have sudo privileges, Standard User Accounts created on the host machine will not.

Setup your OpenSSH Server

To install an OpenSSH server on your host machine:

sudo apt-get install openssh-server

Enable PasswordAuthentication in your sshd_config file

To configure your OpenSSH server, "first, make a backup of your sshd_config file by copying it to your home directory, or by making a read-only copy in /etc/ssh by doing:"

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults
sudo chmod a-w /etc/ssh/sshd_config.factory-defaults

"Once you've backed up your sshd_config file, you can make changes with any text editor, for example:"

sudo gedit /etc/ssh/sshd_config

Find the line with the phrase PasswordAuthentication and make it read:

PasswordAuthentication yes

Save your new sshd_config file and then restart the host machine's ssh service:

sudo restart ssh

Setup Port Forwarding on your local router to direct traffic to your OpenSSH server

Note the port your host machine's ssh service listens to in the sshd_config file and setup your router to forward TCP/UDP traffic aimed at this port to the IP address of your OpenSSH server.

  • Typically, you can point your web browser to 192.168.1.1 in order to login to your router and setup port forwarding.

Connect to your host machine and login to your Administrative User Account with sudo privileges

  • To open an SFTP shell terminal as <username> on the host machine, open a Terminal on your client machine and enter the following command, replacing 123.123.1.23 with your host machine's IP address:

    sftp <username>@123.123.1.23
    
    • If you changed the port number your host machine's OpenSSH server listens to, do:

      sftp -P <port_number_in_host_machine's_sshd_config_file> <username>@123.123.1.23
      
  • To open an SSH shell terminal as <username> on the host machine, open a Terminal on your client machine and enter the following command, replacing 123.123.1.23 with your host machine's IP address:

    ssh <username>@123.123.1.23
    
    • If you changed the port number your host machine's OpenSSH server listens to, do:

      ssh -p <port_number_in_host_machine's_sshd_config_file> <username>@123.123.1.23
      

Alternatively, if you simply want to use sftp to visually access the host machine's filesystem (e.g., using Nautilus)

  1. Open Nautilus on the client machine
  2. Select File > Connect to Server
  3. Type: SSH
  4. Server: Enter your host machine's IP address
  5. Port: port number specified in host machine's sshd_config file
  6. User name: username
  7. Password: password

enter image description here

Create Standard User Accounts on host machine with limited file permissions outside their home folder

If I understand you correctly, proper file permissions in place on the host machine guarantee that each standard user (without sudo privileges) that you create on the host machine will own their /home/new_user directory but have limited permissions with the rest of the directory structure.

  • Limited permissions does not mean they are unable to view filenames and directory structure.

Hope that's helpful!

hazrpg
  • 956