Install Tomcat on Fedora VM for @msdev

This is continuation from Previous article on how to create a Fedora VM, with SFTP installed/configured ( This article is for @msdev who’re unfamiliar with Linux environment.

STEP 1. Download Java SDK (it includes JRE). Then install Java on linux box under path /usr/java/jdk and /usr/java/jre
You may download from your Windows development box, then follow these instructions ( to upload package to your Linux server box via SFTP.
@msdev, if you’re not familiar with Linux commands, the following commands may be handy.
cd /usr
mkdir java
cd /home/johndoe
mv jdk-8u25-linux-i586.gz /usr/java
tar -xvf jdk-8u25-linux-i586.gz
Also in case if you want to delete something:
rmdir ./SomeDirectory (SomeDirectory must be empty)
rm -rf ./SomeDirectory    (non-empty directory)
rm SomeFile (Delete a file)
Also to set environment variables for java Temporarily:
export PATH=

To set the env var permanently, add the same line to ~/.bashrc.

export PATH=/usr/java/jdk1.8.0_25/bin:$PATH

STEP 2. Download and install Apache Tomcat under path /usr/apache/tomcat
Download Tar.gz package from here:

To configure JAVA_HOME and CATALINA_HOME, place a in the the /usr/apache/tomcat/apache-tomcat-7.0.57/bin directory with


STEP 3. Start Tomcat

Navigate to /usr/apache/tomcat/apache-tomcat-7.0.57/bin

From your Windows box hosting the VM, you can access the default webpage hosted by Tomcat. Test from Browser:

8080 is Tomcat default port, which can be changed from server.xml in conf folder.

Next, we’ll discuss how to develop a simple Java-WS (Web Service), put it on Fedora VM (on VirtualBox), the consume it from a dotnet Console Application on Windows box.

Happy Coding!


Setup Linux VM with SFTP, Guide for @msdev

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

Ubuntu x64                           (username: osboxes, pwd:


Ubuntu_12.04-64bit.7z                        (username: vuser, pwd: vuser)



Fedora x86        (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 “”. Similarly, host will also acquire a virtual NIC and IP address 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

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:

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:

groupadd sftp_users

useradd johndoe

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:

cd /etc/ssh

vi sshd_config

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!”:

ChrootDirectory /home

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:

sftp johndoe@localhost

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:


Happy Coding!