Often we come across structures of a particular protein or peptide that adopts somewhat different conformations in the solid state (crystal structures) and in the solution state (NMR structures). Clearly this suggests that the intrinsic propensity of an amino acid sequence to adopt a particular secondary structure must necessarily also be modulated by the environment. We apply computational methods to investigate this interplay and use Human beta defensin 2 (HBD-2) as an example. HBD-2 is a 41 amino-acid naturally occurring antimicrobial peptide with a rigid core structure resulting from three disulfide bonds. The 11 N-terminal residues are flexible and display helical conformations in the crystal state. However, a truncated version of the peptide (missing 4 amino acids from the N-terminus) assumes a beta strand conformation in solution. Hamiltonian replica exchange molecular dynamics simulations revealed that the preference of helical conformation in crystal state arises from reduced backbone hydration. In contrast, in solution, water molecules can competitively form hydrogen bonds with the backbone atoms, resulting in loss of helicity. Moreover, the helical conformation in the crystal is further stabilized by a salt bridge between Asp4 of one monomer and Lys10 of the adjacent monomer; this salt bridge is missing in solution. Only the crystal environment brings two monomers into close proximity in a unit cell. This study clearly suggests that the relationship between the conformations of a peptide and its micro-environment should be carefully examined and factored into peptide design strategies.