The present study is an attempt to estimate the energy and the exergy potential of a biogas run dual fuel diesel engine using emulsified rice bran biodiesel (RBB) as pilot fuel at varying compression ratio (CR) and injection timing (IT). The objective is to arrive at an optimum setting of the engine based on dual fuel characteristics using energy and exergy analysis. The pilot fuel considered for this study is a two-phase stable water emulsion of RBB having water content (5%), surfactants (3%), and hydrophilic lipophilic balance value of 6. For experimentation, a 3.5 kW single cylinder, direct injection (DI), natural aspirated water-cooled, variable CR (VCR) diesel engine is converted into a dual fuel engine. Experiments are conducted for 12 different combinations of CR of 18, 17.5, and 17 and IT of 23 deg, 26 deg, 29 deg, and 32 deg bottom top dead center (BTDC) at full load conditions of brake mean effective pressure (BMEP) of 4.24 bar. The parameters analyzed are the energy and exergy potential of fuel input, shaft work, cooling water, exhaust gas, exergy destruction, peak cylinder pressure (PCP), peak heat release rate (PHRR), brake thermal efficiency (BTE), exergy efficiency, exhaust gas temperature (EGT), entropy generation rate, and emission analysis. The results indicate that the combination of CR = 18 and IT = 29 deg BTDC gives a better thermodynamic performance for this particular range of the operating parameters for a raw biogas run dual fuel diesel engine using emulsified RBB as pilot fuel.