This article will quickly shows, in particular for #msdev who’re not familiar with Linux, how to set up a 32 bit Fedora VM with VirtualBox, and setup a SFTP server, then connect from Filezilla client from Windows machine hosting the Fedora VM.
STEP 1. Create Linux VM on VirtualBox. First, download vdi/vmdk image of Linux operating system. Google for “vdi vmdk Ubuntu” for example. Make sure you download an x64 image with username/pwd specified! Similar for SuSE, Fedora …etc
http://www.osboxes.org/ubuntu/ (username: osboxes, pwd: osboxes.org)
http://imagesvm.sourceforge.net/ (username: vuser, pwd: vuser)
http://cable2.cs.ucdavis.edu/FedoraVM.rar (username: root, pwd: Pwl!ghsnts.)
This version has Desktop pre-installed.
Active user account(s) (username/password): root/reverse, fedora/reverse
Then follow these instructions.
Don’t forget to check “Enable PAE/NX”
And add a second Network Adapter if your first Adapter is configured in NAT mode.
“Please check the network settings of the Ubuntu VM. If it is configured in NAT mode (which is the default mode), then you will not be able to access your windows 7 host from your VM nor will you be able to access your VM from outside. If that is the case, you can add another virtual network adapter to the VM and configure the network mode as “Host-only Adapter”, so that it would get an IP address in the series of “192.168.56.xxx”. Similarly, host will also acquire a virtual NIC and IP address 192.168.56.1. Now you would be able to communicate between the VM and the host using the 192.168.56.x network.”
Please note that if you enabled this Host-only adapter, you wouldn’t be able to for example ping cnn.com
You wouldn’t be able to:
yum repolist all yum info kernel
Instead you’d get error:
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again
(Anyway, you’d still need to fix a few things for yum to work. REF: http://digitizor.com/2009/06/17/how-to-fix-the-cannot-retrieve-repository-metadata-repomd-xml-error-in-fedora-11)
Also, if you’re downloading the vm to test mono, try download a supported distribution (Ubuntu, SuSE for example):
Also, Right-CTRL is default hotkey for VirtualBox to exit mouse capture.
*** The following steps for Fedora ***
STEP 2. Create user account:
passwd johndoe (Then it will prompt you to enter the pwd for ‘johndoe’. For this exercise, pwd=SomePassw0rd)
usermod -G sftp_users johndoe
STEP 3. Then config and start SFTP server like this:
Press INSERT to enter text in vi.
Press ESC when done. Then “:wq!” to save+exit
To set /home as root folder, modify “ChrootDirectory” setting using vi, then hit “wq!”:
Also, comment out and add a line like below
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sft
Then restart the service:
systemctl restart sshd.service
And try connect locally:
Then, try connect to VM from your Windows workstation hosting the VM? From VM command prompt, type ifconfig (not ipconfig) to identify IP address of your VM (2nd Network Adapter).
Then from for example, Filezilla client: